- struct iface *iface = iface_lookup(br, ofproto_port.name);
- if (iface) {
- if (iface->ofp_port >= 0) {
- VLOG_WARN("bridge %s: interface %s reported twice",
- br->name, ofproto_port.name);
- } else if (iface_from_ofp_port(br, ofproto_port.ofp_port)) {
- VLOG_WARN("bridge %s: interface %"PRIu16" reported twice",
- br->name, ofproto_port.ofp_port);
- } else if (!strcmp(ofproto_port.type, iface->type)) {
- iface_set_ofp_port(iface, ofproto_port.ofp_port);
- } else {
- /* Port has incorrect type so delete it later. */
- }
- } else {
- struct if_cfg *if_cfg = if_cfg_lookup(br, ofproto_port.name);
-
- if (if_cfg) {
- iface_create(br, if_cfg, ofproto_port.ofp_port);
- } else if (bridge_has_bond_fake_iface(br, ofproto_port.name)
- && strcmp(ofproto_port.type, "internal")) {
- /* Bond fake iface with the wrong type. */
- bridge_ofproto_port_del(br, ofproto_port);
- } else {
- struct ofpp_garbage *garbage = xmalloc(sizeof *garbage);
- garbage->ofp_port = ofproto_port.ofp_port;
- list_push_front(&br->ofpp_garbage, &garbage->list_node);
- }
+ if (!bridge_refresh_one_ofp_port(br, &ofproto_port)) {
+ struct ofpp_garbage *garbage = xmalloc(sizeof *garbage);
+ garbage->ofp_port = ofproto_port.ofp_port;
+ list_push_front(&br->ofpp_garbage, &garbage->list_node);