summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-15 19:07:35 +0200
committerTom Gundersen <teg@jklm.no>2014-07-15 19:07:35 +0200
commit53af3b7564d9c16720aa06b8bdd2aa054f952bff (patch)
tree9c41512a897b8ddf6316370dea657454f40ff47d /src/network
parentf5de5b00204f041aaec828d336c8afd9e860a5c3 (diff)
networkd: netdev - set mac for bond/bridge devicse
Suggested by poma.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-netdev-bond.c10
-rw-r--r--src/network/networkd-netdev-bridge.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/src/network/networkd-netdev-bond.c b/src/network/networkd-netdev-bond.c
index 89e3965d16..55cef0d8db 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 9a8bf57ee6..dc43129403 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,