diff options
| author | Louis Scalbert <louis.scalbert@6wind.com> | 2024-03-27 15:04:38 +0100 | 
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2024-04-23 11:26:49 +0200 | 
| commit | d346d1ac414c7ce5db6cc7e6b539dc8820d499d3 (patch) | |
| tree | 33d1ec1361b6b53f9a1ca1babe67f0fb0c267058 /bgpd/bgp_updgrp_packet.c | |
| parent | 166a82ca6a3e3e1da83925902b046d93bc063758 (diff) | |
Revert "bgpd: fix 6vpe nexthop"
This reverts commit 0325116a27258e1df773a046e8668a029bead60c.
It was causing an issue where a nexthop for IPv6 over an IPv4 session
was always rewritten to an IPv4-mapped IPv6 address even when a valid
IPv6 global address was existing.
Link: https://github.com/FRRouting/frr/issues/15610
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'bgpd/bgp_updgrp_packet.c')
| -rw-r--r-- | bgpd/bgp_updgrp_packet.c | 15 | 
1 files changed, 5 insertions, 10 deletions
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index bff52c80d8..7502bf2ec6 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -523,16 +523,11 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,  			gnh_modified = 1;  		} -		if (peer->nexthop.v4.s_addr != INADDR_ANY && -		    (IN6_IS_ADDR_UNSPECIFIED(mod_v6nhg) || -		     (peer->connection->su.sa.sa_family == AF_INET && -		      paf->afi == AFI_IP6))) { -			/* set a IPv4 mapped IPv6 address if no global IPv6 -			 * address is found or if announcing IPv6 prefix -			 * over an IPv4 BGP session. -			 */ -			ipv4_to_ipv4_mapped_ipv6(mod_v6nhg, peer->nexthop.v4); -			gnh_modified = 1; +		if (IN6_IS_ADDR_UNSPECIFIED(mod_v6nhg)) { +			if (peer->nexthop.v4.s_addr != INADDR_ANY) { +				ipv4_to_ipv4_mapped_ipv6(mod_v6nhg, +							 peer->nexthop.v4); +			}  		}  		if (IS_MAPPED_IPV6(&peer->nexthop.v6_global)) {  | 
