*: Remove null pointer checks on codeXCALLOC/XMALLOC and XREALLOC cannot fail, as such
checking for NULL is redundant and unnecessary, remove.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
*: use event_is_scheduled() for struct event * truth testsThe pattern:
if (event)
Should really be:
if (event_is_scheduled(event))
Replace.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
*: Drop redundant if-guard before event_cancel()The pattern of:
if (event)
event_cancel();
makes no sense, just do a `event_cancel()`. That is sufficient.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
*: drop redundant struct event * NULL assignmentsThe event system when calling a event handler has already
set the event pointer to NULL that was handed in. There
is no need to do this again.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra: explicitly cancel event timers instead of null'ing pointerInstead of null'ing pointers, explicitly cancel the event timer
as that leaving a event dangling is dangerous and causes problems.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
pimd: cancel pim sock read event before recreating socketThe code was using this as a pattern:
event = NULL;
event_add_timer(...,&event,...);
This can leave a dangling event in the event system. Explicitly
cancel and then restart.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd: cancel rfapi withdraw timer before re-armingWe have this pattern:
event = NULL
event_add_timer(..., &event...);
FRR code should never set a event to NULL as that any existing
timer will be run but the ability to stop it has been lost,
modify the code to cancel the event and then add the timer again.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
ospfd: use XCALLOC for ospf_apiserver allocationsospf_apiserver.c is using XMALLOC for alloc'ing memory,
switch over to XCALLOC and drop the NULL pointer assignments
to event structures as well as the memset.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
ldpd: Cleanup event system handling of pointersThere are several classes of problems:
a) event pointer is set to NULL inside the handler function.
This is unnecessary and redundant, so we can safely remove the
set.
b) event_cancel is called then the event pointer is set to
NULL. Again this is redundant.
c) fresh calloc call we set the event pointer to NULL.
This is redundant.
d) Actual bug, use malloc to grab memory and then
call some ...
bgpd: bmp: force 32-bit ASN encoding for BMP route monitoringBMP route-monitoring messages need a stable AS_PATH ASN encoding width:
the per-peer header's A flag (RFC 7854 4.2) tells the collector whether
AS_PATH ASNs are 2-byte or 4-byte. FRR's BMP code never sets the A flag
(only V and L are ever set in bgp_bmp.c), so every BMP message
advertises A=0 (4-byte AS_PATH format).
However, the AS_PATH bytes that bgp_packet_attribute() actually writes
to the...
bgpd: bmp: don't prepend local-AS to AS_PATH in BMP updatesBMP Route Monitoring messages for monitored routes carried an AS_PATH
with the local AS prepended, as if the route were being re-advertised
outbound. Observed with a peer in AS 40001 advertising 100.100.100.1/32
to a router in AS 40002:
"as_path":[40002,40001], "as_path_count":2, "peer_asn":40001
The collector expected AS_PATH=[40001] -- the value as received from
the peer -- but saw [400...
pimd: defer AutoRP default discovery until config is appliedDo not start AutoRP discovery from VRF enable. Apply default-on
discovery from northbound apply_finish callbacks on the auto-rp
container and pim address-family once configuration is committed,
and track when discovery-enabled is explicitly configured so
"no autorp discovery" is honored before any join is attempted.
Runtime VRFs created after initial config load still receive
default discovery...
docs: document AutoRP discovery purge and mapping agentDocument immediate removal of learned RPs when discovery is disabled
and add user guide coverage for autorp send-rp-discovery.
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
pimd: join AutoRP multicast groups based on active roleJoin 224.0.1.40 only for discovery and 224.0.1.39 only for mapping
agents, instead of always joining both groups.
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
tests: verify AutoRP RPs are purged when discovery is disabledAdd a topotest that learns an AutoRP RP, disables discovery, and
checks that only static RP entries remain in rp-info.
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
pimd: purge learned AutoRP RPs when discovery is disabledRemove AutoRP-installed RPs immediately on `no autorp discovery`
instead of waiting for the discovery hold timer to expire.
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
tests: harden bgp_conditional_advertisement_track_peer convergence waitsbgp_conditional_advertisement_track_peer.test_bgp_conditional_advertisement_track_peer
fails intermittently on loaded CI hosts (e.g. AddressSanitizer Debian 12 amd64):
AssertionError: R1 SHOULD receive 172.16.255.2/32 from R2
After enabling the R2-R3 session, R1 must learn 172.16.255.2/32 only once R2
receives the exist-map prefix 172.16.255.3/32 from R3 and the conditional
advertisement sc...
tests: PIM join prune test topologyNetwork topology with three routers simulating a big number of IGMP
joins to stress test the PIM join prune code path.
The router 3 sends 2000 IGMP joins to router 1, router 1 sends PIM join
prune to router 2.
The test checks if all the IGMP joins are learned by router 1 (and if
they successfully were sent to router 2) and then check if router 2
received all the PIM joins.
Signed-off-by: Raf...
pimd: refactor PIM join prune packet generationThe previous version of the code had three problems:
1. There was no upper limit on the amount of sources a group could have
and when that number was too high it would cause a buffer overflow
2. When the first group had too many sources an empty group would be
generated
3. When a group have too many sources there was no code to split them
into multiple packets
The refactor addr...
Merge pull request #22021 from opensourcerouting/fix/bgp_move_otc_attribute_to_extrabgpd: Move OTC and IPv6 extended community attributes to attr_extra
bgpd: Use stream_new_expandable() for BMP code to avoid overflowAlso, validate and drop packets later exceeding 65k.
Reported-by: Qifan Zhang, Palo Alto Networks
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
tests: fix flaky IGMP source checks in pim_boundary_acltest_pim_asm_igmp_join_acl intermittently failed at its opening check
with "expected has key 'r1-eth0' which is not present in output". The
test intent was correct (verify no IGMP source for the ASM/SSM group
before sending joins), but the assertion did not match how FRR reports
IGMP sources.
"show ip igmp sources json" only emits interface keys when that interface
has at least one source entr...
tests: fix multicast_pim_sm_topo2 TC_15/TC_7 mroute flakinessTC_15 was no-shutting the wrong interface after shut/no-shut of the
upstream links, leaving l1-r2-eth4 and f1-r2-eth3 down and breaking
(S,G) verification in the following test. Reset PIM state at TC_15
teardown and restart traffic in TC_7 after all receivers join.
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
tests: add DM->SM transition coverage to pim_dense topotestAdd helpers and an end-to-end test that verifies an existing dense (S,G)
transitions to sparse mode when an RP is added for its group range.
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
pimd: move dense (S,G) to sparse mode when an RP is addedRe-evaluate existing dense upstreams when RP mappings change, clear
stale DM OIF state before syncing the kernel MFC, and treat groups as
sparse once an RP is configured on sparse-dense interfaces.
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
zebra: On shutdown unlink kernel and table routesOn shutdown kernel and table routes were being left
in their respective tables in zebra and when finalize was called
it would create a context to delete them. We need
to just remove these routes on shutdown.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests: Cleanup review commentsTighten up test code for these two things:
a) check_nhg_sent_to_fpm needed to be able to see error messages
from a run_and_expect block so it can be communicated better what
has gone wrong.
b) knowledge of sending of data to the fpm can be gated by
what zebra thinks it knows. The topotest was confusing this
modify the topotest to grab the data it is looking for from
asking the fpm_listener w...
zebra: On delay install of NHG send to the fpmCurrently zebra sends connected/local/kernel routes NHG's to the
kernel only upon initial usage outside of one of these 3. Modify
the code to send the result down but to ignore the installation
into the kernel. There are dplanes out there that are using
the nhg's created for the connected routes being installed,
which are also ignored by the linux kernel.
Signed-off-by: Donald Sharp <sharpd@...