]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: route_node_lookup() needs to apply_mask() to prefix 835/head
authorDaniel Walton <dwalton@cumulusnetworks.com>
Wed, 19 Jul 2017 16:54:24 +0000 (16:54 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Wed, 19 Jul 2017 16:54:24 +0000 (16:54 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: <qlyoung@cumulusnetworks.com>
lib/table.c

index 8e84d803ea4e25b700bee1e73052e38e62fa9c71..2defa4fb62e9bc27d993c5fb1b6f7439566a1a17 100644 (file)
@@ -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;
 }