netdev-vport: Fix poll_add() implementation.
authorBen Pfaff <blp@nicira.com>
Mon, 15 Nov 2010 20:48:31 +0000 (12:48 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 17 Nov 2010 17:21:09 +0000 (09:21 -0800)
The existing implementation never worked because it used different strings
for notifier shash addition and lookup: for adding to the shash, it used
the vport name; for lookup, it used "<type>:<name>".  This fixes the
problem, by using "<type>:<name>" in both cases.

lib/netdev-vport.c

index 5ea7cbd..5ab0586 100644 (file)
@@ -386,8 +386,7 @@ netdev_vport_poll_add(struct netdev *netdev,
     if (!shash_node) {
         list = xmalloc(sizeof *list);
         list_init(list);
-        shash_node = shash_add(&netdev_vport_notifiers,
-                              netdev_get_name(netdev), list);
+        shash_node = shash_add(&netdev_vport_notifiers, poll_name, list);
     } else {
         list = shash_node->data;
     }