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 9930441c66)
This commit is contained in:
Donatas Abraitis 2023-02-24 22:01:15 +02:00 committed by Mergify
parent 9a72aeeb04
commit 35b2225b90

View File

@ -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 {