]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Avoid double aspath_dup() for confederation when remote-as != AS_SPECIFIED
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 24 Feb 2023 20:01:15 +0000 (22:01 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sat, 25 Feb 2023 00:18:04 +0000 (00:18 +0000)
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)

bgpd/bgp_attr.c

index 00a194f5c6e9ac08c7d4ee96f64a68453acac3fb..8e66a229c3c1b4f3f23432e56f027a3269413e57 100644 (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 {