From: Ben Pfaff Date: Fri, 5 Jun 2009 21:28:39 +0000 (-0700) Subject: vswitch: Enable bond slaves based on carrier status, not up/down. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2633c26a1066c394cf71d579819bb230ee281b0;p=openvswitch 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. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index cfd4dcf7..ff5d3529 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,