mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 08:56:13 +00:00
bgpd: add missing checks for vpnv6 nexthop lengths
A few code paths weren't handling the vpnv6 nexthop lenghts as expected, which was leading to problems like imported vpnv6 routes not being marked as valid when they should. Fix this. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
de4d0a517c
commit
dc94fe42a4
@ -279,7 +279,10 @@ struct bgp_static {
|
||||
|
||||
#define BGP_ATTR_NEXTHOP_AFI_IP6(attr) \
|
||||
(!CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP)) \
|
||||
&& ((attr)->mp_nexthop_len == 16 || (attr)->mp_nexthop_len == 32))
|
||||
&& ((attr)->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL \
|
||||
|| (attr)->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL \
|
||||
|| (attr)->mp_nexthop_len == BGP_ATTR_NHLEN_VPNV6_GLOBAL \
|
||||
|| (attr)->mp_nexthop_len == BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL))
|
||||
#define BGP_PATH_COUNTABLE(BI) \
|
||||
(!CHECK_FLAG((BI)->flags, BGP_PATH_HISTORY) \
|
||||
&& !CHECK_FLAG((BI)->flags, BGP_PATH_REMOVED))
|
||||
|
@ -945,14 +945,17 @@ bgp_path_info_to_ipv6_nexthop(struct bgp_path_info *path, ifindex_t *ifindex)
|
||||
struct in6_addr *nexthop = NULL;
|
||||
|
||||
/* Only global address nexthop exists. */
|
||||
if (path->attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL) {
|
||||
if (path->attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL
|
||||
|| path->attr->mp_nexthop_len == BGP_ATTR_NHLEN_VPNV6_GLOBAL) {
|
||||
nexthop = &path->attr->mp_nexthop_global;
|
||||
if (IN6_IS_ADDR_LINKLOCAL(nexthop))
|
||||
*ifindex = path->attr->nh_ifindex;
|
||||
}
|
||||
|
||||
/* If both global and link-local address present. */
|
||||
if (path->attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL) {
|
||||
if (path->attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL
|
||||
|| path->attr->mp_nexthop_len
|
||||
== BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL) {
|
||||
/* Check if route-map is set to prefer global over link-local */
|
||||
if (path->attr->mp_nexthop_prefer_global) {
|
||||
nexthop = &path->attr->mp_nexthop_global;
|
||||
|
Loading…
Reference in New Issue
Block a user