zebra: Clean up possible memory leaks on shutdown of clientWhen cleaninmg up a client and at the same time the decision
was made to shutdown, ensure that streams are not leaked.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests: Add a specific test to show that nht resolution changesWhen two different clients are both tracking the same nexthop
let's ensure that they can resolve to different nexthops and
at reconverge when the different routes change.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests: Fix all_protocol_startup for nht changesThe nht output has changed and is being updated to reflect
the reality of how it actually works now.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra: Change rnh data structure to be per clientCurrently when a client protocol does nexthop tracking
the created rnh is shared for each client that wants
to watch a particular prefix. This had the bad behavior
of causing problems when two clients are trying to track
the same prefix/address but have different flags. The
last watcher will win and change the flags. This
can/will cause upper level protocols to match to the
wrong prefix, thu...
doc: Exclude 240.0.0.0/4 from allow-reserved-rangesIt's already included (whitelisted) by default.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
gdb: Move the bgp macros to their own fileNot everyone wants to load the bgp macros when debugging
a different daemon
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
gdb: Add dump_pim_upstream and dump_jp_agg_list macrosAdd a bit of macro magic to allow the dump of these data
structures from pim.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests: add missed show coverage- drill query down into generic vrf state that would exclude zebra specific
state.
Signed-off-by: Christian Hopps <chopps@labn.net>
eigrpd: Prevent crash in packet handlingeigrp will crash on a lan segment with more than one
neighbor on shutdown in some situations. Let's just
fix it.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra: Remove zrouter.zav.asic_notification_nexthop_controlThis value has been in deprecation for over a year. Let's remove
it now. No-one has come forth and told us that they were using
this code at all. Safe to assume it's dead.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests: show some broken pim behaviorThere exists a topology, where we can show
that pim has some broken behavior. Create
a test that shows this but do not turn it
on to be run for every run.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd: Optimize BGP path lookup using typesafe hash for efficient lookupProblem:
--------
BGP path lookup currently uses O(N) linear search through the list
(dest->info) for every incoming route update. In high-ECMP scenarios,
each update requires iterating through the entire path list to check
if a path from that peer already exists.
This becomes a severe performance bottleneck in data center environments
with high ECMP during large-scale route updates churn.
So...
ci: add retry logic for apt and curl to handle transient failuresUbuntu package mirrors can experience transient failures during CI
runs, causing builds to fail with 404 errors even though the packages
exist. Similarly, fetching GPG keys from external servers may fail
due to temporary network issues.
This patch introduces an APT_RETRIES build argument (defaulting to 3)
that controls the number of retry attempts for network operations.
The apt configuration ...
bgpd: Use the default local-preference value and not 0 when adjustingIf we use something like:
route-map x permit 10
set local-preference +10
We treat that a default is 0, but it's not. We MUST respect the default
BGP local preference value that is set.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
isisd: fix terminate() destruction order for DLIST callbacksMove vrf_terminate() and prefix_list_reset() before isis_master_terminate().
Their callbacks (isis_vrf_disable, isis_prefix_list_update) iterate over
im->isis list which is finalized by isis_master_terminate(). With typesafe
DLIST, iterating a finalized list causes a SEGV crash.
Signed-off-by: Vincent Jardin <vjardin@free.fr>
isisd: fix isis_area_destroy destruction order for DLISTFix destruction order in isis_area_destroy() to prevent crashes when
terminating areas with typesafe DLIST.
Two issues were addressed:
1. Move isis_mpls_te_term() before circuit list cleanup because it
iterates over circuit_list to delete extended sub-TLVs.
2. Move isis_sr_area_term() and isis_srv6_area_term() before
isis_mpls_te_term() because SR adj_sids reference structures inside
...
isisd: convert area_addrs from linked list to typesafe DLISTConvert the isis_area->area_addrs field from the legacy struct list *
to the FRR typesafe DLIST container. This change is part of the ongoing
effort to migrate IS-IS data structures to typesafe containers for
improved type safety and code clarity.
Signed-off-by: Vincent Jardin <vjardin@free.fr>
tests: fix minor memory leak in test_isis_lspdbAddressSanitizer detected the isis structure allocated in main() was
never freed. This is a minor test code issue with no impact on isisd
itself.
Signed-off-by: Vincent Jardin <vjardin@free.fr>
isisd: fix memory leak for MT settings static buffersThe multi-topology code in isis_mt.c uses three static buffers to avoid
repeated memory allocations during MT settings lookups. These buffers
are allocated using XREALLOC in area_mt_settings(), circuit_mt_settings(),
and circuit_bcast_mt_set(), growing as needed but never freed during
daemon shutdown.
This causes the memory leak checker to report three "ISIS MT Area Setting"
allocations per ro...
isisd: fix crash in isis_area_destroy destruction orderMove lsp_db_fini() before circuit list cleanup in isis_area_destroy().
The lsp_destroy() function iterates over circuit_list to remove LSPs
from tx queues. With typesafe lists, a finalized list is invalid
(not NULL), so accessing it causes a crash.
Signed-off-by: Vincent Jardin <vjardin@free.fr>
isisd: migrate lists to typesafe DLISTMigrate IS-IS lists from the legacy list API to FRR's typesafe.h
DLIST macros:
- isis_instance_list (im->isis)
- isis_area_list (isis->area_list)
- isis_circuit_list (area->circuit_list)
- isis_area_adj_list (area->adjacency_list)
Update iteration patterns from ALL_LIST_ELEMENTS_RO/ALL_LIST_ELEMENTS
to frr_each/frr_each_safe, and replace listnode_add/listnode_delete
with typesafe list operatio...
isisd: fix code formatting in files to be modifiedApply clang-format to source files that will be modified by subsequent
commits in this branch. This ensures consistent code style before
introducing new functionality.
Signed-off-by: Vincent Jardin <vjardin@free.fr>
lib: fix static analyzer false positive in DLIST _pop macroAdd an explicit NULL check in the DLIST _pop function to satisfy
static analyzers that cannot track the DLIST invariant.
The DLIST implementation guarantees that hitem.next is never NULL -
it either points to the first element or back to the sentinel for
an empty list. However, static analyzers see a pointer loaded from
a struct field and assume it could be NULL.
The added NULL check:
- Satis...