From c2633c26a1066c394cf71d579819bb230ee281b0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 5 Jun 2009 14:28:39 -0700 Subject: [PATCH] vswitch: Enable bond slaves based on carrier status, not up/down. Whether a bond slave is enabled should be based on whether the device's PHY sees carrier, not based on whether the device is configured up or down. (Note that a device that is configured down will always see "no carrier"). Otherwise a device that is up but has no carrier will initially be enabled, which does not make sense. This has no effect on interfaces that are not bond slaves, because the "enabled" setting is used only by bond slaves. Bug #1247. --- vswitchd/bridge.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index cfd4dcf75..ff5d35298 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -2467,7 +2467,6 @@ port_update_vlan_compat(struct port *port) static void iface_create(struct port *port, const char *name) { - enum netdev_flags flags; struct iface *iface; iface = xcalloc(1, sizeof *iface); @@ -2476,14 +2475,10 @@ iface_create(struct port *port, const char *name) iface->name = xstrdup(name); iface->dp_ifidx = -1; iface->tag = tag_create_random(); - iface->enabled = true; iface->delay_expires = LLONG_MAX; netdev_nodev_get_etheraddr(name, iface->mac); - - if (!netdev_nodev_get_flags(name, &flags)) { - iface->enabled = (flags & NETDEV_UP) != 0; - } + netdev_nodev_get_carrier(name, &iface->enabled); if (port->n_ifaces >= port->allocated_ifaces) { port->ifaces = x2nrealloc(port->ifaces, &port->allocated_ifaces, -- 2.43.0