]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: rfapi: track outstanding rib and import timers, free mem at exit 18546/head
authorG. Paul Ziemba <paulz@labn.net>
Sun, 30 Mar 2025 22:43:04 +0000 (15:43 -0700)
committerG. Paul Ziemba <paulz@labn.net>
Mon, 31 Mar 2025 15:45:33 +0000 (08:45 -0700)
commit1629c05924fe96ab487d3ba6bafbe7f11679274c
treeffd7011cd3564be153c6157deb16a44ca4c93b64
parenta02ec27693ddfa708ec1f62400af6cea533bf1e8
bgpd: rfapi: track outstanding rib and import timers, free mem at exit

    While here, also make "VPN SAFI clear" test wait for clear result
    (tests/topotests/bgp_rfapi_basic_sanity{,_config2})

    Original RFAPI code relied on the frr timer system to remember
    various allocations that were supposed to be freed at future times
    rather than manage a parallel database. However, if bgpd is terminated
    before the times expire, those pending allocations are marked as
    memory leaks, even though they wouldn't be leaks under normal operation.

    This change adds some hash tables to track these outstanding
    allocations that are associated with pending timers, and uses
    those tables to free the allocations when bgpd exits.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
bgpd/bgpd.c
bgpd/rfapi/rfapi.c
bgpd/rfapi/rfapi_backend.h
bgpd/rfapi/rfapi_import.c
bgpd/rfapi/rfapi_import.h
bgpd/rfapi/rfapi_rib.c
bgpd/rfapi/rfapi_rib.h
tests/topotests/bgp_rfapi_basic_sanity/r3/bgpd.conf
tests/topotests/bgp_rfapi_basic_sanity/scripts/cleanup_all.py
tests/topotests/bgp_rfapi_basic_sanity_config2/r3/bgpd.conf