X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=vswitchd%2Fbridge.c;h=354d4d89452a46adef4771dbbf478cb6a23d35de;hb=776f10ce0f008e95b457f8c6b69b9748d8d1fdbd;hp=e20d407387785f5f6cb999ef0e7b2d092cbc893e;hpb=3e9c481c70473b5faa29c72a1e609a31ddb6b990;p=openvswitch diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index e20d4073..354d4d89 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -3391,8 +3391,6 @@ port_reconfigure(struct port *port, const struct ovsrec_port *cfg) } bitmap_free(port->trunks); port->trunks = trunks; - - shash_destroy(&new_ifaces); } static void @@ -3615,6 +3613,8 @@ iface_create(struct port *port, const struct ovsrec_interface *if_cfg) iface->netdev = NULL; iface->cfg = if_cfg; + shash_add_assert(&br->iface_by_name, iface->name, iface); + /* Attempt to create the network interface in case it doesn't exist yet. */ if (!iface_is_internal(br, iface->name)) { error = set_up_iface(if_cfg, iface, true); @@ -3622,14 +3622,13 @@ iface_create(struct port *port, const struct ovsrec_interface *if_cfg) VLOG_WARN("could not create iface %s: %s", iface->name, strerror(error)); + shash_find_and_delete_assert(&br->iface_by_name, iface->name); free(iface->name); free(iface); return NULL; } } - shash_add_assert(&br->iface_by_name, iface->name, iface); - if (port->n_ifaces >= port->allocated_ifaces) { port->ifaces = x2nrealloc(port->ifaces, &port->allocated_ifaces, sizeof *port->ifaces);