bgpd: Reject malformed SRv6 End.X sub-TLV payloads with leftover bytesBGP-LS SRv6 End.X sub-TLV parsing currently accepts payloads that leave
unparsed bytes at the end (for example, fewer than a full TLV header).
Treat this as malformed input by adding a post-parse check in
parse_endx_sub_tlvs(): if bytes remain after parsing complete TLV
header/value pairs, return -1.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
doc: fix spell check in developer and user rst guideCorrect typos across doc/developer and doc/user
(no functional changes).
Signed-off-by: Chirag Shah <chirag@nvidia.com>
bgpd: Remove redundant BGP-LS NLRI forward declarationsbgp_route.c declares two local prototypes for:
- bgp_ls_nlri_format()
- bgp_ls_nlri_to_json()
bgp_ls.h already declares both, and bgp_route.c includes that
header. Remove the duplicate forward declarations and use the
prototypes from bgp_ls.h
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
*: don't use static char buffer in srv6 zapi codeDon't use a static buffer for the "locator name" in some
zapi apis - the one caller can supply a buffer.
Signed-off-by: Mark Stapp <mjs@cisco.com>
*: Use hash_clean_and_free, remove hash_freeRan across a single case of a hash bucket not being freed,
on shutdown. Let's convert everything to use hash_clean_and_free
and remove usage of hash_free outside of the .c file.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests: make the topotest fail if a memory leak is detectedCurrently the topotests output a bunch of memory leaks detected
on shutdown, modify the code such that the memory leaks are detected
and cause the test to fail.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
pimd: cleanup of leaked memory on shutdowna) route-map memory was not being cleaned up
b) Some mld memory was not being cleaned up
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
*: Cleanup snmp memory leaksbgpd, ospf6d, ospfd and zebra were not cleaning up snmp smux
data structures no shutdown. Do so.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
ldpd: Fixup memory leaks on shutdowna) zclient memory not cleaned up on shutdown, fix.
b) libfrr memory not cleaned up on shutdown, fix.
c) lde label list not cleaned up on shutdown, fix.
d) snmp memory not cleaned up on shutdown, fix.
e) accept memory not cleaned up on shutdown, fix.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra: cleanup memory leaks on shutdowna) vxlan memory leaks on shutdown, fix.
b) evpn-mh memory leaks on shutdown, fix.
c) mpls-fec memory leaks on shutdown, fix.
d) route-map memory leaks on shutdown, fix.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
sharpd: memory leaks on shutdown cleanupa) srv6 memory leaks on shutdown, stop
b) nexthop-group memory leaks on shutdown, stop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
nhrpd: Cleanup nhrpd termination memory leaksa) interface gre memory leaks, stop
b) packet request id memory leaks, stop
c) event request id memory leaks, stop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
pbrd: termination cleanup of memory leaksa) pbr maps were being leaked, stop
b) nexthop-groups were being leaked, stop
c) access list's were being leaked, stop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd: Cleanup memory leaks on shutdowna) tx addpath id's not being cleaned up properly, fix.
b) evpn memory leaks on shutdown, fix.
c) route_nodes not being properly released on shutdown, fix.
d) rpki memory leaks on shutdown, fix.
e) srv6 memory leaks on shutdown, fix.
f) hidden bgp instances memory leaks on recreate, fix.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
topotests: add bgp_evpn_rt2_local_leakTest with the topology of issue #16161.
Link: https://github.com/FRRouting/frr/issues/16161
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
bgpd: do not add local vtep as remoteThe previous commit has a side effect on "show evpn vni json".
The local VTEP is added to the list of remote VTEPs.
Do not add the local VTEP as remote.
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
bgpd: export local rt2 mac+ip entries to unicastLocal EVPN MAC+IP RT2 entries are currently not exported to the
unicast RIB of their own VRF, nor to other VRFs. Only remote RT2
entries may be exported to other VRFs, if configuration allows.
This can lead to sub-optimal routing when VTEPs are also connected
via IPv4 unicast. In such cases, bgpd may lack /32 host routes for
locally learned EVPN endpoints.
Example:
- r1 peers via IPv4 unica...
isisd: Clean up and memory leaks in isisa) isisd is using a MTYPE_TMP in a bunch of different places,
add better descriptors and break it up a bit.
b) Cleanup of sbuf usage such that memory is not leaked on shutdown.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests: Tell fpm_listener to shutdownAllow gcoverage to work with fpm_listener
Currently there is no way to tell fpm_listener to shutdown,
so let's allow it to listen to signals and cleanly shutdown.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra: fpm_listener has signal handlers nowAdd signal handlers for fpm_listener.c. This will allow
it to be shutdown cleanly, such that gcoverage can work.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib: ferr memory leakedUsage of the frr pthread specific error messages were not being
cleaned up. Make it so.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib: nexthop-group termination cleanup of memory leaksNexthop groups were leaking memory on shutdown. Add the
ability to cleanup memory leaks from a using daemon.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
pim6d: cleanup complaint about unneeded destroyMake the complaint about a unneeded destroy in nb code go away.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
debian: add pkg.frr.tcmalloc build profile for tcmalloc supportAdd a pkg.frr.tcmalloc build profile that passes --enable-gperf-tcmalloc
to configure when active. Also add libgoogle-perftools-dev as a
profile-gated build dependency.
This allows building FRR Debian packages with tcmalloc support by
specifying the pkg.frr.tcmalloc build profile, similar to how
pkg.frr.grpc and pkg.frr.asan profiles work.
Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
bgpd: Skip route clearing for peers that were never establishedWhen bgp_fsm_change_status() transitions a peer to Clearing or Deleted
state, it still unconditionally calls bgp_clear_route_all() which walks the
entire BGP table. For peers that were not in Established state (e.g.,
doppelganger peers from TCP collision resolution), this walk is pure overhead
The previous fix(e0ae285) uses peer->established which is a monotonically
increasing counter that is ...
bgpd: use bgp_node_match() instead of bgp_node_get() in aggregate countbgp_node_get() creates a transient node in the aggregate table for the
route prefix just to anchor a parent walk, which is wasteful.
bgp_node_match() does a longest-prefix match and returns only nodes
where aggregate data is actually present, without creating any new node.
Return early if bgp_node_match() returns NULL, meaning no covering
aggregate exists for the route prefix.
Signed-off-by: E...
tests: Ensure that `no network ...` actually worksShow that the no network command works properly for
VPN routes in bgp.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd: Allow `no network ....` form for safi = EVPN or MPLS_VPNCurrently when you negate a network statement for bgp:
router bgp 3295425
address-family ipv4 vpn
network 10.0.0.0/24 rd 1:1 label 2000
You get `no such network`. Fix the code to allow for deletion:
eva# do show bgp ipv4 vpn
BGP table version is 1, local router ID is 192.168.122.1, vrf id 0
Default local pref 100, local AS 329395
Status codes: s suppressed, d damped, h history, u unsort...