From: Daniel Walton Date: Wed, 19 Jul 2017 16:54:24 +0000 (+0000) Subject: lib: route_node_lookup() needs to apply_mask() to prefix X-Git-Tag: frr-4.0-dev~501^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b37aead99b7e1923618de0ef0860784f3ea96b54;p=mirror%2Ffrr.git lib: route_node_lookup() needs to apply_mask() to prefix Signed-off-by: Daniel Walton Reviewed-by: --- diff --git a/lib/table.c b/lib/table.c index 8e84d803ea..2defa4fb62 100644 --- a/lib/table.c +++ b/lib/table.c @@ -277,10 +277,12 @@ struct route_node *route_node_match_ipv6(const struct route_table *table, struct route_node *route_node_lookup(const struct route_table *table, union prefixconstptr pu) { - const struct prefix *p = pu.p; + struct prefix p; struct route_node *node; + prefix_copy(&p, pu.p); + apply_mask(&p); - node = hash_get(table->hash, (void *)p, NULL); + node = hash_get(table->hash, (void *)&p, NULL); return (node && node->info) ? route_lock_node(node) : NULL; } @@ -288,10 +290,12 @@ struct route_node *route_node_lookup(const struct route_table *table, struct route_node *route_node_lookup_maynull(const struct route_table *table, union prefixconstptr pu) { - const struct prefix *p = pu.p; + struct prefix p; struct route_node *node; + prefix_copy(&p, pu.p); + apply_mask(&p); - node = hash_get(table->hash, (void *)p, NULL); + node = hash_get(table->hash, (void *)&p, NULL); return node ? route_lock_node(node) : NULL; }