]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: attr evpn attributes should be modified before interning attr
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 31 Jan 2023 08:27:01 +0000 (09:27 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 24 Feb 2023 07:16:36 +0000 (08:16 +0100)
commit7171949de55066f6f73ec7ced19a6b0cb96872a8
treed212ebd6c229aabbf1c836568e122aab2af1fc21
parent6fafecdc67713b12df0a01a58df5dec7ed5604d2
bgpd: attr evpn attributes should be modified before interning attr

As remind, the attr attribute is a structure that contains
the attributes for a given BGP update. In order to avoid too much
memory consumption, the attr structure is stored in a hash table.
As consequence, other BGP updates may reuse the same attr. The
storage in the hash table is done when calling bgp_attr_intern(),
and a key is calculated based on all the attributes values of the
structure.

In BGP EVPN, when modifying the attributes of the attr structure
after having interned it, this means that some BGP updates will
want to use the old reference, whereas a new attr value is used.
Because in BGP EVPN, the modifications are done on a per BGP update
basis, a new attr entry specific to that BGP update should be created.
This is why a local_attr structure is done, modified, then later
interned.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_evpn.c