]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: fix route_node_get
authorChirag Shah <chirag@cumulusnetworks.com>
Wed, 23 Aug 2017 17:29:27 +0000 (10:29 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Sun, 27 Aug 2017 23:09:24 +0000 (16:09 -0700)
Call apply_mask() where route_node_get() is performed,
for the prefix to fetch correct node.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
ospfd/ospf_abr.c
ospfd/ospf_interface.c
ospfd/ospf_route.c

index c6d4364fa3c1adefe9e9f8309dbe22ba03e6cd0a..968461b4d00592cf7a1ca7f7ee997b25bad5db5c 100644 (file)
@@ -76,6 +76,7 @@ static void ospf_area_range_add(struct ospf_area *area,
        p.family = AF_INET;
        p.prefixlen = range->masklen;
        p.prefix = range->addr;
+       apply_mask_ipv4(&p);
 
        rn = route_node_get(area->ranges, (struct prefix *)&p);
        if (rn->info)
@@ -123,6 +124,7 @@ struct ospf_area_range *ospf_area_range_lookup_next(struct ospf_area *area,
        p.family = AF_INET;
        p.prefixlen = IPV4_MAX_BITLEN;
        p.prefix = *range_net;
+       apply_mask_ipv4(&p);
 
        if (first)
                rn = route_top(area->ranges);
index 54639afd6c852cf4cf2bb52f8ddc6f14eec7d3d0..422e1a2a6b6e7b95ea1a852ae59aedff6fc04e74 100644 (file)
@@ -171,6 +171,7 @@ static void ospf_add_to_if(struct interface *ifp, struct ospf_interface *oi)
 
        p = *oi->address;
        p.prefixlen = IPV4_MAX_PREFIXLEN;
+       apply_mask(&p);
 
        rn = route_node_get(IF_OIFS(ifp), &p);
        /* rn->info should either be NULL or equal to this oi
@@ -562,6 +563,7 @@ struct ospf_if_params *ospf_get_if_params(struct interface *ifp,
        p.family = AF_INET;
        p.prefixlen = IPV4_MAX_PREFIXLEN;
        p.prefix = addr;
+       apply_mask_ipv4(&p);
 
        rn = route_node_get(IF_OIFS_PARAMS(ifp), (struct prefix *)&p);
 
index 9c4dca2e2fbea2ed79e2c4dbc2000c9d920b6546..89ea331b52b5b149418dc96e99934ddc3182a7be 100644 (file)
@@ -356,6 +356,7 @@ void ospf_intra_add_router(struct route_table *rt, struct vertex *v,
        p.family = AF_INET;
        p.prefix = v->id;
        p.prefixlen = IPV4_MAX_BITLEN;
+       apply_mask_ipv4(&p);
 
        if (IS_DEBUG_OSPF_EVENT)
                zlog_debug("ospf_intra_add_router: talking about %s/%d",