X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=vswitchd%2Fbridge.c;h=04898f88d9689787c3f344e692b3fc61417668dd;hb=70d3fbe7658b59bac65f8b4f2ba03602acf7f1c2;hp=74c7d57858fc656ecbf9b9b2b404985b4da6a84c;hpb=d25b341aa8ce7062a0995adfe1a8e4321c10a727;p=openvswitch diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 74c7d578..04898f88 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1986,11 +1986,11 @@ bond_wait(struct bridge *br) for (j = 0; j < port->n_ifaces; j++) { struct iface *iface = port->ifaces[j]; if (iface->delay_expires != LLONG_MAX) { - poll_timer_wait(iface->delay_expires - time_msec()); + poll_timer_wait_until(iface->delay_expires); } } if (port->bond_fake_iface) { - poll_timer_wait(port->bond_next_fake_iface_update - time_msec()); + poll_timer_wait_until(port->bond_next_fake_iface_update); } } } @@ -3613,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); @@ -3620,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);