summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorMark Oteiza <mvoteiza@udel.edu>2014-03-05 10:41:13 +0100
committerTom Gundersen <teg@jklm.no>2014-03-05 10:41:20 +0100
commit0ad6148e87cd1348be81d9e83c4364a09dab2c29 (patch)
treef932288df30aa2ea9841629d8e43dd44879bd7e6 /src/network/networkd-link.c
parenta9a245c128af6c0418085062c60251bc51fa4a94 (diff)
networkd: restore logic for enslaving to a master bonding interface
This partially reverts commit 54abf46, which unintentionally removed the enslaving support for bonding interfaces
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index c10d947589..61e257c1d5 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1194,6 +1194,27 @@ static int link_enter_enslave(Link *link) {
link->enslaving ++;
}
+ if (link->network->bond) {
+ log_struct_link(LOG_DEBUG, link,
+ "MESSAGE=%s: enslaving by '%s'",
+ link->ifname, link->network->bond->name,
+ NETDEV(link->network->bond),
+ NULL);
+
+ r = netdev_enslave(link->network->bond, link, &enslave_handler);
+ if (r < 0) {
+ log_struct_link(LOG_WARNING, link,
+ "MESSAGE=%s: could not enslave by '%s': %s",
+ link->ifname, link->network->bond->name, strerror(-r),
+ NETDEV(link->network->bond),
+ NULL);
+ link_enter_failed(link);
+ return r;
+ }
+
+ link->enslaving ++;
+ }
+
HASHMAP_FOREACH(vlan, link->network->vlans, i) {
log_struct_link(LOG_DEBUG, link,
"MESSAGE=%s: enslaving by '%s'",