X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto-dpif.c;h=cc37d947fb6d871c67633ec2b6aae3a9d28b1834;hb=02f8d6460afdb95d18e193bc0476f1fa8933aeb3;hp=098a43ee48453f1d123cb1c9c9ca49e271adf2ad;hpb=0958f12880427e4f3ea3fcc758a3ddf681ae6f5d;p=openvswitch diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 098a43ee..cc37d947 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1538,19 +1538,17 @@ port_destruct(struct ofport *port_) { struct ofport_dpif *port = ofport_dpif_cast(port_); struct ofproto_dpif *ofproto = ofproto_dpif_cast(port->up.ofproto); - struct dpif_port dpif_port; + const char *devname = netdev_get_name(port->up.netdev); - if (!dpif_port_query_by_number(ofproto->backer->dpif, - port->odp_port, &dpif_port)) { + if (dpif_port_exists(ofproto->backer->dpif, devname)) { /* The underlying device is still there, so delete it. This * happens when the ofproto is being destroyed, since the caller * assumes that removal of attached ports will happen as part of * destruction. */ dpif_port_del(ofproto->backer->dpif, port->odp_port); - dpif_port_destroy(&dpif_port); } - sset_find_and_delete(&ofproto->ports, netdev_get_name(port->up.netdev)); + sset_find_and_delete(&ofproto->ports, devname); hmap_remove(&ofproto->backer->odp_to_ofport_map, &port->odp_port_node); ofproto->need_revalidate = REV_RECONFIGURE; bundle_remove(port_);