From: Renato Westphal Date: Tue, 5 Sep 2017 11:06:23 +0000 (-0300) Subject: zebra: use the afi parameter in rib_add_multipath() X-Git-Tag: frr-4.0-dev~277^2~7 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7990990e54f2145b5d2527cb4af00de9d77ba10c;p=mirror%2Ffrr.git zebra: use the afi parameter in rib_add_multipath() Signed-off-by: Renato Westphal --- diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 039fac4e67..7c43c38f42 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -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 { diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index bb49663319..7c140598c2 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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;