From: Donatas Abraitis Date: Fri, 24 Feb 2023 20:01:15 +0000 (+0200) Subject: bgpd: Avoid double aspath_dup() for confederation when remote-as != AS_SPECIFIED X-Git-Tag: frr-8.5-rc~3^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=35b2225b90951a4a4019da4ecfa3001c65a550e3;p=mirror%2Ffrr.git bgpd: Avoid double aspath_dup() for confederation when remote-as != AS_SPECIFIED Just was blind when not seing it's already dup'ed above: ``` if (peer->sort == BGP_PEER_EBGP && (!CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_AS_PATH_UNCHANGED) || attr->aspath->segments == NULL) && (!CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT))) { aspath = aspath_dup(attr->aspath); <<<<<<<<<<<<<<< ``` Signed-off-by: Donatas Abraitis (cherry picked from commit 9930441c66131d26fd7c51d9684b9e6a228c38d7) --- diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 00a194f5c6..8e66a229c3 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -4364,7 +4364,6 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer, * if the peer belongs to us. */ if (bgp_confederation_peers_check(bgp, peer->as)) { - aspath = aspath_dup(attr->aspath); aspath = aspath_add_confed_seq(aspath, peer->local_as); } else {