[ovs-dev] [ofproto tests 02/29] netdev-vport: Fix poll_add() implementation.

Ben Pfaff blp at nicira.com
Tue Nov 16 19:20:52 UTC 2010


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 |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
index 5ea7cbd..5ab0586 100644
--- a/lib/netdev-vport.c
+++ b/lib/netdev-vport.c
@@ -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;
     }
-- 
1.7.1





More information about the dev mailing list