If the "nexthop-local unchanged" setting is enabled, it preserves the
IPv6 link-local nexthop from the originating peer. However, if the
originating and destination peers are not on the same network segment,
the originating peer's IPv6 link-local address will be unreachable from
the destination peer.
In such cases, reset the IPv6 link-local nexthop, even if "nexthop-local
unchanged" is set on the destination peer.
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* ensure more prefixes share the same attribute for
* announcement.
*/
- if (!(CHECK_FLAG(peer->af_flags[afi][safi],
- PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED)))
+ if (!(CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED)) ||
+ !IPV6_ADDR_SAME(&peer->nexthop.v6_global, &from->nexthop.v6_global))
+ /* Reset if "nexthop-local unchanged" is not set or originating and destination peer
+ * does not share the same subnet.
+ */
memset(&attr->mp_nexthop_local, 0, IPV6_MAX_BYTELEN);
}