From 10b78e7d091b85a2808bac9dd24d7fd3cfeaa8b1 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 21 Apr 2011 16:25:41 -0700 Subject: [PATCH] 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. --- ofproto/ofproto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 39e2b30e..fb63606a 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1203,6 +1203,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; -- 2.30.2