summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-02-24 22:01:15 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-02-25 00:18:04 +0000
commit4f01db503a828760fa81680263f7c0077cbbae87 (patch)
tree40a0cfffbfede677fae2f5cc51e0ac9bab841dbd
parent2a053fecd291590bf55b53a4bfd980ec40d54776 (diff)
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 <donatas@opensourcerouting.org> (cherry picked from commit 9930441c66131d26fd7c51d9684b9e6a228c38d7)
-rw-r--r--bgpd/bgp_attr.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index f38e92b4f8..212d770842 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -4019,7 +4019,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 {