summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2023-02-01 16:52:28 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2023-03-22 12:06:29 +0100
commitf081a1924c97837677aaa97c54aff61cb0f7f26d (patch)
tree38904c053bc14fb4efdbe676fead669fe2934af8
parent02a3c6bef7022675d2c2291961b98c90f687c1bf (diff)
bgpd: remove ATTR_NEXT_HOP for redistributed ipv6 nexthops
This commit addresses an issue with an MPLS VPN network redistributing static routes that are exported to the VPN, and where the labels are allocated per next-hop. For that purpose, the nexthop of the static routes is checked against the nexthop tracking. The validation of a valid nexthop will trigger the use of a unique label for all prefixes using that destination. However, the nexthop fails to be validated, with the following message: > evaluate_paths: prefix 172:31::14/128 (vrf vrf1), ignoring path due to > martian or self-next-hop The reason is due to the way the attr is created. By default, the ATTR_NEXTHOP attribute is set for all prefixes, whereas this flag should only be valid for IPv4. In the case there is an IPv6 nexthop, remove the ATTR_NEXTHOP flag. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
-rw-r--r--bgpd/bgp_route.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index dd78a38977..e035ccdd0e 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -8666,6 +8666,9 @@ void bgp_redistribute_add(struct bgp *bgp, struct prefix *p,
*/
assert(attr.aspath);
+ if (p->family == AF_INET6)
+ UNSET_FLAG(attr.flag, ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP));
+
switch (nhtype) {
case NEXTHOP_TYPE_IFINDEX:
switch (p->family) {