vtep-ctl: Fix a bug.
authorAlex Wang <alexw@nicira.com>
Tue, 9 Jun 2015 05:57:09 +0000 (22:57 -0700)
committerAlex Wang <alexw@nicira.com>
Thu, 11 Jun 2015 23:27:32 +0000 (16:27 -0700)
add_port_to_cache() uses 'cache_name' as the shash node name for
shash_add().  So, the del_cached_port() must also pass 'cache_name'
as argument for shash_find_and_delete().

This bug does not cause any issue currently but should be fixed.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
vtep/vtep-ctl.c

index ead22ea..a501a98 100644 (file)
@@ -798,7 +798,7 @@ del_cached_port(struct vtep_ctl_context *ctx, struct vtep_ctl_port *port)
     char *cache_name = xasprintf("%s+%s", port->ps->name, port->port_cfg->name);
 
     list_remove(&port->ports_node);
-    shash_find_and_delete(&ctx->ports, port->port_cfg->name);
+    shash_find_and_delete(&ctx->ports, cache_name);
     vteprec_physical_port_delete(port->port_cfg);
     free(cache_name);
     free(port);