]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: Ensure that the correct aspath is free'd
authorDonald Sharp <sharpd@nvidia.com>
Wed, 13 Mar 2024 14:26:58 +0000 (10:26 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 14 Mar 2024 08:26:15 +0000 (08:26 +0000)
commit3103af698b4b05c1eb70a201b5e595991dbe0093
tree4cad5a5abf20cf360752f5df3c24d97f69b62754
parent21d6498ad092cb08fb3d146e983b91eee4cc8158
bgpd: Ensure that the correct aspath is free'd

Currently in subgroup_default_originate the attr.aspath
is set in bgp_attr_default_set, which hashs the aspath
and creates a refcount for it.  If this is a withdraw
the subgroup_announce_check and bgp_adj_out_set_subgroup
is called which will intern the attribute.  This will
cause the the attr.aspath to be set to a new value
finally at the bottom of the function it intentionally
uninterns the aspath which is not the one that was
created for this function.  This reduces the other
aspath's refcount by 1 and if a clear bgp * is issued
fast enough the aspath for that will be removed
and the system will crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit e613e12f12b9274520ff2a8650496bdeb97e011c)
bgpd/bgp_updgrp_adv.c