diff options
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r-- | src/network/networkd-link.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index d07cc30951..77c505fc78 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1466,7 +1466,9 @@ static int link_enter_enslave(Link *link) { link_save(link); - if (!link->network->bridge && !link->network->bond && + if (!link->network->bridge && + !link->network->bond && + !link->network->tunnel && hashmap_isempty(link->network->vlans) && hashmap_isempty(link->network->macvlans)) return link_enslaved(link); @@ -1515,6 +1517,28 @@ static int link_enter_enslave(Link *link) { link->enslaving ++; } + if (link->network->tunnel) { + log_struct_link(LOG_DEBUG, link, + "MESSAGE=%s: enslaving by '%s'", + link->ifname, link->network->tunnel->name, + NETDEV(link->network->tunnel), + NULL); + + r = netdev_enslave(link->network->tunnel, link, &enslave_handler); + if (r < 0) { + log_struct_link(LOG_WARNING, link, + "MESSAGE=%s: could not enslave by '%s': %s", + link->ifname, link->network->tunnel->name, strerror(-r), + NETDEV(link->network->tunnel), + NULL); + link_enter_failed(link); + return r; + } + + link_ref(link); + link->enslaving ++; + } + HASHMAP_FOREACH(vlan, link->network->vlans, i) { log_struct_link(LOG_DEBUG, link, "MESSAGE=%s: enslaving by '%s'", |