]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: delete NULL assignment in bgp_attr_hash_alloc
authorRyoga Saito <contact@proelbtn.com>
Thu, 16 Dec 2021 14:09:55 +0000 (23:09 +0900)
committerRyoga Saito <contact@proelbtn.com>
Thu, 16 Dec 2021 14:28:12 +0000 (23:28 +0900)
commit3d1ae061a352ae7a5c215ece62b2bdb9992a2596
tree6ab00a8b48e78a165f5df6abbc70dd37dcd0c806
parentad1229a077f09d7d7bcfe7bf453730666e6324f5
bgpd: delete NULL assignment in bgp_attr_hash_alloc

If soft-reconfiguration is enabled, bgp_adj_in_set will be called
from bgp_update and bgp_adj_in_set will call bgp_attr_intern to intern
attr pointer. If given attr isn't found in attrhash, hash_get will call
bgp_attr_hash_alloc to allocate new attr structure. In
bgp_attr_hash_alloc, NULL will be assigned to srv6_vpn field and
srv6_l3vpn field in origin attr pointer. attr->srv6_vpn and
attr->srv6_l3vpn are interned in bgp_attr_intern, so NULL assignment
isn't needed.

And, these fields are used later in bgp_update to set SRv6 information
to bgp_path_info. If bgp_attr_hash_alloc assign NULL to these fields,
SRv6 information will be lost and incorrect routes are inserted into
data-plane.

Signed-off-by: Ryoga Saito <contact@proelbtn.com>
bgpd/bgp_attr.c