From: Ben Pfaff Date: Thu, 21 Apr 2011 23:25:41 +0000 (-0700) Subject: ofproto: Adjust netdev_monitor when switching netdevs. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=380e7027848836e4024ef5e8232ef27bcad9451f;p=sliver-openvswitch.git ofproto: Adjust netdev_monitor when switching netdevs. This fixes a segfault in the "ofproto - mod-port" test. The segfault should not occur--there must be a bug in the netdev_monitor or possibly the netdev_dummy implementation--but the netdev_monitor_remove() and netdev_monitor_add() calls are definitely wanted here in any case to ensure that the new netdev, not the old one, is what gets monitored. --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 24958c410..9bcef2ce6 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1681,6 +1681,9 @@ ofport_modified(struct ofproto *ofproto, struct ofport *port, port->opp.supported = opp->supported; port->opp.peer = opp->peer; + netdev_monitor_remove(ofproto->netdev_monitor, port->netdev); + netdev_monitor_add(ofproto->netdev_monitor, netdev); + netdev_close(port->netdev); port->netdev = netdev;