]> git.puffer.fish Git - mirror/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)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 13 Mar 2024 23:28:11 +0000 (19:28 -0400)
commite613e12f12b9274520ff2a8650496bdeb97e011c
treee398aa39fa777e80ca5fa03ce2184f3ec2cfcacc
parent75bd2716cf131e8e63f0da9cf5e37717341907ae
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>
bgpd/bgp_updgrp_adv.c