diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-09-14 19:17:54 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-12-21 20:26:09 -0500 |
| commit | d4a2bc11adc87fb6dc7d460080d65fde017a964f (patch) | |
| tree | 74b93ad1e22dd90edb8de1ea9bb0dcea672e9e8f /pimd/pim_zlookup.c | |
| parent | 7b2c4d167e1b6ac3e8391f2492cfadc756126542 (diff) | |
pimd, zebra: Pass the ifindex for NEXTHOP_TYPE_IPV4
NEXTHOP_TYPE_IPV4 has the ifindex of the route. Pass it
along so the other side can use it if it is needed.
This will make pim much happier in that we will need to do less
recursive lookups.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_zlookup.c')
| -rw-r--r-- | pimd/pim_zlookup.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index f649098060..f81c6e8781 100644 --- a/pimd/pim_zlookup.c +++ b/pimd/pim_zlookup.c @@ -233,8 +233,10 @@ static int zclient_read_nexthop(struct zclient *zlookup, switch (nexthop_type) { case NEXTHOP_TYPE_IFINDEX: case NEXTHOP_TYPE_IPV4_IFINDEX: + case NEXTHOP_TYPE_IPV4: nexthop_tab[num_ifindex].nexthop_addr.family = AF_INET; - if (nexthop_type == NEXTHOP_TYPE_IPV4_IFINDEX) { + if (nexthop_type == NEXTHOP_TYPE_IPV4_IFINDEX || + nexthop_type == NEXTHOP_TYPE_IPV4) { nexthop_tab[num_ifindex].nexthop_addr.u.prefix4.s_addr = stream_get_ipv4(s); } else { @@ -245,23 +247,6 @@ static int zclient_read_nexthop(struct zclient *zlookup, nexthop_tab[num_ifindex].route_metric = metric; ++num_ifindex; break; - case NEXTHOP_TYPE_IPV4: - nexthop_tab[num_ifindex].nexthop_addr.family = AF_INET; - nexthop_tab[num_ifindex].nexthop_addr.u.prefix4.s_addr = stream_get_ipv4(s); - nexthop_tab[num_ifindex].ifindex = 0; - nexthop_tab[num_ifindex].protocol_distance = distance; - nexthop_tab[num_ifindex].route_metric = metric; - if (PIM_DEBUG_ZEBRA) { - char addr_str[100]; - char nexthop_str[100]; - pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str)); - pim_addr_dump("<nexthop?>", &nexthop_tab[num_ifindex].nexthop_addr, nexthop_str, sizeof(nexthop_str)); - zlog_debug("%s %s: zebra returned recursive nexthop %s for address %s", - __FILE__, __PRETTY_FUNCTION__, - nexthop_str, addr_str); - } - ++num_ifindex; - break; case NEXTHOP_TYPE_IPV6_IFINDEX: nexthop_tab[num_ifindex].nexthop_addr.family = AF_INET6; stream_get (&nexthop_tab[num_ifindex].nexthop_addr.u.prefix6, s, 16); |
