summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index f496978cba..7c738fe81c 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1492,7 +1492,7 @@ static int enslave_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
}
static int link_enter_enslave(Link *link) {
- NetDev *vlan, *macvlan;
+ NetDev *vlan, *macvlan, *vxlan;
Iterator i;
int r;
@@ -1508,7 +1508,8 @@ static int link_enter_enslave(Link *link) {
!link->network->bond &&
!link->network->tunnel &&
hashmap_isempty(link->network->vlans) &&
- hashmap_isempty(link->network->macvlans))
+ hashmap_isempty(link->network->macvlans) &&
+ hashmap_isempty(link->network->vxlans))
return link_enslaved(link);
if (link->network->bond) {
@@ -1625,6 +1626,27 @@ static int link_enter_enslave(Link *link) {
link->enslaving ++;
}
+ HASHMAP_FOREACH(vxlan, link->network->vxlans, i) {
+ log_struct_link(LOG_DEBUG, link,
+ "MESSAGE=%*s: enslaving by '%s'",
+ IFNAMSIZ,
+ link->ifname, vxlan->ifname, NETDEV(vxlan), NULL);
+
+ r = netdev_enslave(vxlan, link, &enslave_handler);
+ if (r < 0) {
+ log_struct_link(LOG_WARNING, link,
+ "MESSAGE=%*s: could not enslave by '%s': %s",
+ IFNAMSIZ,
+ link->ifname, vxlan->ifname, strerror(-r),
+ NETDEV(vxlan), NULL);
+ link_enter_failed(link);
+ return r;
+ }
+
+ link_ref(link);
+ link->enslaving ++;
+ }
+
return 0;
}