Merge pull request #1990 from donaldsharp/bgp_v6_ifindex

bgpd: Only supply ifindex for a v6 nexthop if LL
This commit is contained in:
Russ White 2018-03-30 09:25:52 -04:00 committed by GitHub
commit b69592ccbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1255,12 +1255,17 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
ifindex = mpinfo->peer->nexthop.ifp ifindex = mpinfo->peer->nexthop.ifp
->ifindex; ->ifindex;
} }
if (ifindex == 0)
continue; if (IN6_IS_ADDR_LINKLOCAL(nexthop)) {
if (ifindex == 0)
continue;
} else
ifindex = 0;
api_nh->gate.ipv6 = *nexthop; api_nh->gate.ipv6 = *nexthop;
api_nh->ifindex = ifindex; api_nh->ifindex = ifindex;
api_nh->type = NEXTHOP_TYPE_IPV6_IFINDEX; api_nh->type = ifindex ? NEXTHOP_TYPE_IPV6_IFINDEX
: NEXTHOP_TYPE_IPV6;
} }
if (mpinfo->extra if (mpinfo->extra