summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-05-09 12:20:21 +0200
committerTom Gundersen <teg@jklm.no>2014-05-09 14:41:27 +0200
commitd9c67ea112724e271c39553d966eae612e272e34 (patch)
tree3ca8d7b46a4767cb73929e6067121b9326110c93 /src
parent699370c98d37e4b373795f62cba9ff7bade5f2a1 (diff)
networkd: reorder bonding and bridging
A link should only ever be part of one, but if we accidentally do both, let's do it in the right order so the failure is more obvious in the logs.
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-link.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 0a228b29a1..7cb9ee6754 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1490,19 +1490,19 @@ static int link_enter_enslave(Link *link) {
hashmap_isempty(link->network->macvlans))
return link_enslaved(link);
- if (link->network->bridge) {
+ if (link->network->bond) {
log_struct_link(LOG_DEBUG, link,
"MESSAGE=%s: enslaving by '%s'",
- link->ifname, link->network->bridge->name,
- NETDEV(link->network->bridge),
+ link->ifname, link->network->bond->name,
+ NETDEV(link->network->bond),
NULL);
- r = netdev_enslave(link->network->bridge, link, &enslave_handler);
+ 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->bridge->name, strerror(-r),
- NETDEV(link->network->bridge),
+ link->ifname, link->network->bond->name, strerror(-r),
+ NETDEV(link->network->bond),
NULL);
link_enter_failed(link);
return r;
@@ -1512,19 +1512,19 @@ static int link_enter_enslave(Link *link) {
link->enslaving ++;
}
- if (link->network->bond) {
+ if (link->network->bridge) {
log_struct_link(LOG_DEBUG, link,
"MESSAGE=%s: enslaving by '%s'",
- link->ifname, link->network->bond->name,
- NETDEV(link->network->bond),
+ link->ifname, link->network->bridge->name,
+ NETDEV(link->network->bridge),
NULL);
- r = netdev_enslave(link->network->bond, link, &enslave_handler);
+ r = netdev_enslave(link->network->bridge, 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),
+ link->ifname, link->network->bridge->name, strerror(-r),
+ NETDEV(link->network->bridge),
NULL);
link_enter_failed(link);
return r;