aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-04-21 16:25:41 -0700
committerBen Pfaff <blp@nicira.com>2011-04-29 14:32:00 -0700
commite6ed263114e071865884531f5756d7d30035d93d (patch)
tree6dec5d15a032bd9757eac7c1e4e0db8c4b95c042
parent7174e5aed2a6d2877c1760d2ae921ae24d7accb5 (diff)
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.
-rw-r--r--ofproto/ofproto.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index f44b7369..737b86b5 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -1202,6 +1202,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;