diff options
| author | Russ White <russ@riw.us> | 2018-03-30 09:25:52 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-30 09:25:52 -0400 |
| commit | b69592ccbb60b2179cae9d048e1d543ed51a6907 (patch) | |
| tree | ad73896101696746965b9759db1055fab96c367a | |
| parent | 9e1d8e806799d917d009f4496c7f732b07292aa3 (diff) | |
| parent | d4f8783d9575c86b6ae829cb27ee6118895edd0c (diff) | |
Merge pull request #1990 from donaldsharp/bgp_v6_ifindex
bgpd: Only supply ifindex for a v6 nexthop if LL
| -rw-r--r-- | bgpd/bgp_zebra.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 269dcc7cb6..e07701d42d 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1255,12 +1255,17 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p, ifindex = mpinfo->peer->nexthop.ifp ->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->ifindex = ifindex; - api_nh->type = NEXTHOP_TYPE_IPV6_IFINDEX; + api_nh->type = ifindex ? NEXTHOP_TYPE_IPV6_IFINDEX + : NEXTHOP_TYPE_IPV6; } if (mpinfo->extra |
