From: Ben Pfaff Date: Tue, 30 Dec 2008 00:17:09 +0000 (-0800) Subject: vswitchd: Fix SIGHUP behavior for bonded ports. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7f378819fbbb1523fb30fb3034254581f52da3b;p=openvswitch vswitchd: Fix SIGHUP behavior for bonded ports. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 139d7f97..f2138324 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1985,6 +1985,7 @@ port_create(struct bridge *br, const char *name) port->port_idx = br->n_ports; port->vlan = 0; port->name = xstrdup(name); + port->active_iface = -1; if (br->n_ports >= br->allocated_ports) { br->ports = x2nrealloc(br->ports, &br->allocated_ports, @@ -2119,8 +2120,8 @@ port_update_bonding(struct port *port) e->iface_idx = -1; e->tx_bytes = 0; } - bond_choose_active_iface(port); port->no_ifaces_tag = tag_create_random(); + bond_choose_active_iface(port); } } } @@ -2156,6 +2157,7 @@ iface_destroy(struct iface *iface) { if (iface) { struct port *port = iface->port; + bool del_active = port->active_iface == iface->port_ifidx; struct iface *del; del = port->ifaces[iface->port_ifidx] = port->ifaces[--port->n_ifaces]; @@ -2164,6 +2166,11 @@ iface_destroy(struct iface *iface) free(iface->name); free(iface); + if (del_active) { + tag_set_add(&port->bridge->revalidate_set, port->active_iface_tag); + bond_choose_active_iface(port); + } + port_update_bonding(port); bridge_flush(port->bridge); }