]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: use the afi parameter in rib_add_multipath()
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 5 Sep 2017 11:06:23 +0000 (08:06 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Thu, 21 Sep 2017 16:27:50 +0000 (13:27 -0300)
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
zebra/rt_netlink.c
zebra/zebra_rib.c

index 039fac4e67d5a9aace331eb5f47060e49502f007..7c43c38f4281abe05518bac8db2ce4ad694c1d27 100644 (file)
@@ -526,7 +526,7 @@ static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
                        if (re->nexthop_num == 0)
                                XFREE(MTYPE_RE, re);
                        else
-                               rib_add_multipath(AFI_IP, SAFI_UNICAST, &p,
+                               rib_add_multipath(afi, SAFI_UNICAST, &p,
                                                  NULL, re);
                }
        } else {
index bb496633191a3934b06964ea52a8d8144960c49e..7c140598c2adc09c0b1d469970386fc0ec7ffe79 100644 (file)
@@ -2216,20 +2216,14 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
        struct route_entry *same;
        struct nexthop *nexthop;
        int ret = 0;
-       int family;
 
        if (!re)
                return 0;
 
-       if (p->family == AF_INET)
-               family = AFI_IP;
-       else
-               family = AFI_IP6;
-
-       assert(!src_p || family == AFI_IP6);
+       assert(!src_p || afi == AFI_IP6);
 
        /* Lookup table.  */
-       table = zebra_vrf_table_with_table_id(family, safi, re->vrf_id,
+       table = zebra_vrf_table_with_table_id(afi, safi, re->vrf_id,
                                              re->table);
        if (!table)
                return 0;