Otherwise we dereference a dangling pointer to the interface when we
look up the interface by datapath port index, causing a segfault.
Introduced in commit
150ac45, "vswitchd: Eliminate "can't forward to bad
port" when interfaces disappear," which deletes an interface that is known
to be in the datapath port index table.
{
if (iface) {
struct port *port = iface->port;
+ struct bridge *br = port->bridge;
bool del_active = port->active_iface == iface->port_ifidx;
struct iface *del;
+ if (iface->dp_ifidx >= 0) {
+ port_array_set(&br->ifaces, iface->dp_ifidx, NULL);
+ }
+
del = port->ifaces[iface->port_ifidx] = port->ifaces[--port->n_ifaces];
del->port_ifidx = iface->port_ifidx;