[systemd-commits] src/network

Tom Gundersen tomegun at kemper.freedesktop.org
Tue Jul 15 10:33:22 PDT 2014


 src/network/networkd-netdev-bond.c   |   10 ++++++++++
 src/network/networkd-netdev-bridge.c |   10 ++++++++++
 2 files changed, 20 insertions(+)

New commits:
commit 53af3b7564d9c16720aa06b8bdd2aa054f952bff
Author: Tom Gundersen <teg at jklm.no>
Date:   Tue Jul 15 19:07:35 2014 +0200

    networkd: netdev - set mac for bond/bridge devicse
    
    Suggested by poma.

diff --git a/src/network/networkd-netdev-bond.c b/src/network/networkd-netdev-bond.c
index 89e3965..55cef0d 100644
--- a/src/network/networkd-netdev-bond.c
+++ b/src/network/networkd-netdev-bond.c
@@ -76,6 +76,16 @@ static int netdev_bond_fill_message_create(NetDev *netdev, sd_rtnl_message *m) {
                 return r;
         }
 
+        if (netdev->mac) {
+                r = sd_rtnl_message_append_ether_addr(m, IFLA_ADDRESS, netdev->mac);
+                if (r < 0) {
+                        log_error_netdev(netdev,
+                                         "Colud not append IFLA_ADDRESS attribute: %s",
+                                         strerror(-r));
+                    return r;
+                }
+        }
+
         r = sd_rtnl_message_open_container(m, IFLA_LINKINFO);
         if (r < 0) {
                 log_error_netdev(netdev,
diff --git a/src/network/networkd-netdev-bridge.c b/src/network/networkd-netdev-bridge.c
index 9a8bf57..dc43129 100644
--- a/src/network/networkd-netdev-bridge.c
+++ b/src/network/networkd-netdev-bridge.c
@@ -43,6 +43,16 @@ static int netdev_bridge_fill_message_create(NetDev *netdev, sd_rtnl_message *m)
                 return r;
         }
 
+        if (netdev->mac) {
+                r = sd_rtnl_message_append_ether_addr(m, IFLA_ADDRESS, netdev->mac);
+                if (r < 0) {
+                        log_error_netdev(netdev,
+                                         "Colud not append IFLA_ADDRESS attribute: %s",
+                                         strerror(-r));
+                    return r;
+                }
+        }
+
         r = sd_rtnl_message_open_container(m, IFLA_LINKINFO);
         if (r < 0) {
                 log_error_netdev(netdev,



More information about the systemd-commits mailing list