X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto.c;h=481d50b845768941c0611bd552d6c2ba669f3151;hb=fa05809b7238ad2db6046ef23d02007f8e7beefc;hp=4c4df9493f5c90b44e923d797d149d84a0377e4d;hpb=db9220c38ee6fd3ff264807e4c32065e5de5140f;p=openvswitch diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 4c4df949..481d50b8 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -414,15 +414,11 @@ ofproto_set_datapath_id(struct ofproto *p, uint64_t datapath_id) uint64_t old_dpid = p->datapath_id; p->datapath_id = datapath_id ? datapath_id : pick_datapath_id(p); if (p->datapath_id != old_dpid) { - struct ofconn *ofconn; - VLOG_INFO("datapath ID changed to %016"PRIx64, p->datapath_id); /* Force all active connections to reconnect, since there is no way to * notify a controller that the datapath ID has changed. */ - LIST_FOR_EACH (ofconn, struct ofconn, node, &p->all_conns) { - rconn_reconnect(ofconn->rconn); - } + ofproto_reconnect_controllers(p); } } @@ -667,6 +663,18 @@ ofproto_set_controllers(struct ofproto *p, } } +/* Drops the connections between 'ofproto' and all of its controllers, forcing + * them to reconnect. */ +void +ofproto_reconnect_controllers(struct ofproto *ofproto) +{ + struct ofconn *ofconn; + + LIST_FOR_EACH (ofconn, struct ofconn, node, &ofproto->all_conns) { + rconn_reconnect(ofconn->rconn); + } +} + static bool any_extras_changed(const struct ofproto *ofproto, const struct sockaddr_in *extras, size_t n)