Commit graph

101 commits

Author SHA1 Message Date
Mark Stapp d378275106 pimd: clean up clang warnings
Clean up clang warnings in pimd; mostly address-of-packed
issues (removed some ugly casts too).

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-16 13:50:21 -04:00
Donald Sharp a6595fde70
Merge pull request #17850 from Jafaral/wr-rpg
pimd: always write cand-rp group config even when rp is inactive
2025-01-14 12:41:15 -05:00
Jafar Al-Gharaibeh 8e66f821bf pimd: always write cand-rp group config even when rp is inactive
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13 23:34:08 -06:00
Jafar Al-Gharaibeh cda66453c1 pimd: explicitly ensure the RP src is BSR
With the recent suppoort of multiple sources of RPs, we can assume non static RPs
are BSR RPs. Just make the check explicit for BSR.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13 10:18:24 -06:00
Jafar Al-Gharaibeh c30a3ad890 pimd: fix BSR RPs timing out
On the BSR node itself, RPs shouldn't timeout, becase we know
the node is the BSR, and it is active!

fixes:#17587

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13 10:18:24 -06:00
Rafael Zalamena 3bebb7be92
Merge pull request #17252 from nabahr/mcast-mode
Fix PIMD RPF lookup mode and nexthop tracking
2024-12-16 09:57:31 -03:00
Nathan Bahr 6d30c8f6b5 pimd: Refactor pim NHT
Refactor the next hop tracking in PIM to fully support the configured RPF lookup mode.
Moved many NHT related functions to pim_nht.h/c
NHT now tracks both MRIB and URIB tables and makes nexthop decisions based on the configured lookup mode.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-12-13 17:36:34 +00:00
Rafael Zalamena a507ca1163 pimd,pim6d: optimize multicast prefix generation
Fix Coverity Scan CID 1602463: make it impossible for the function to fail.

Hardcode the multicast prefix generation instead of calling `str2prefix()`
which caused unnecessary memory allocations and returned error values.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-13 08:28:42 -03:00
Nathan Bahr a060c72530 pimd: Implement autorp mapping agent CLI
Also exposes BSR cand_addrsel methods for use in AutoRP.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-11-19 22:33:11 +00:00
Jafar Al-Gharaibeh 4e74183d0f pimd: allow a bsr with higher priority to take over
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-10-25 09:00:50 -05:00
Jafar Al-Gharaibeh d97bea338d pimd: refactor pim_sock_read to be used with unicast bsr msgs
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-09-09 13:27:49 -05:00
Jafar Al-Gharaibeh 2d0812373c pimd: Candidate-BSR support
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-09-09 13:27:49 -05:00
Jafar Al-Gharaibeh a110bb7798 pimd: Candidate-RP support
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-09-09 12:42:28 -05:00
David Lamparter b9a02da83b pimd: prepare NHT for tracking BSM C-RPs
For BSMs, we should track which of the RP candidates in the BSM message
are actually available, before trying to use them (which also puts them
in NHT for that).  This applies for both BSRs as well as BSM receivers.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 13:10:51 +02:00
Sarita Patra 8b462d5579 pimd: Process no-forward BSM packet
Topology Used:
=============
Cisco---FRR4----FRR2

Initially PIM nbr is down between FRR4----FRR2 from FRR2 side
Cisco is sending BSR packet to FRR4.

Problem Statement:
=================
No shutdown the PIM neighbor on FRR2 towards FRR4.
FRR2, receives BSR packet immediately as the new neighbor
comes up. This BSR packet is having no-forward bit set.
FRR2 is not able to process the BSR packet, and drop the
BSR packet.

Root Cause:
==========
When PIMD comes up, we start BSM timer for 60 seconds.
Here, the value accept_nofwd_bsm is setting to false.

FRR2, when receives no-forward BSR packet, it is getting
accept_nofwd_bsm value as false.

So, it drops, the no-forward BSM packet.

Fix:
===
Set accept_nofwd_bsm as false after first BSM packet received.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-04-09 22:30:44 -07:00
Donald Sharp e16d030c65 *: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 907a2395f4 *: Convert thread_add_XXX functions to event_add_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp e6685141aa *: Rename struct thread to struct event
Effectively a massive search and replace of
`struct thread` to `struct event`.  Using the
term `thread` gives people the thought that
this event system is a pthread when it is not

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
David Lamparter cefb7247f0 pimd: fix unaligned accesses
These are in packed structs at weird offsets (e.g. 2 bytes), and as such
need a memcpy to get them into proper alignment.

It'd be even better if the pimd code used proper de/serialization, but
let's get this improved one step at a time.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-07-12 12:48:04 +02:00
sarita patra c0590b1c59 pim6d: IPV6 adjust in hash_calc_on_grp_rp
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 10:56:45 -07:00
sarita patra f0e91749df Revert "pim6d: IPv6-adjust BSM code"
This reverts commit 809c11a9d8.
2022-07-07 10:56:45 -07:00
sarita patra cefd2343d6 pim6d: remove unused variable neigh_src_str
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 10:56:45 -07:00
sarita patra 81a688bc7b pim6d: add pimv6 support for bsmmsg_grpinfo
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 10:56:45 -07:00
sarita patra 1407e40fc8 pim6d: add pimv6 support for bsmmsg_rpinfo
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 10:56:45 -07:00
sarita patra 1ae87bdd38 pim6d: add pimv6 support for bsm_hdr
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 10:56:45 -07:00
sarita patra 11e1593f9f pim6d: Add pim_addr rp_addr in bsm_rpinfo
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 10:56:43 -07:00
sarita patra 53bbfd535a pim6d: bsr nht handling for IPV6
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 07:53:40 -07:00
sarita patra e309769ae7 pim6d: modify in_addr current_bsr to pim_addr current_bsr
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 07:51:33 -07:00
sarita patra e6e5300636 pim6d: Pass pim_addr for pim_nht callbacks.
For pim callbacks, we pass pim_addr as value, not pointer.
So making it consistent for pim_nht callbacks.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-06 02:56:43 -07:00
sarita patra b63192cfc2 pim6d: Adjust rpf_addr in rp_info
In this PR, we are handling the rp_info
after rpf_addr modified from prefix
to pim_addr.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-06 02:41:47 -07:00
sarita patra fd3eb43d76 pimd: Disable receiving BSM on passive interface
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra ac5c9346b7 pimd: Handling BSM send statistics for passive interface
Increment pim_ifstat_bsm_tx only when interface is
passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
Donald Sharp f526739897 *: Fix spelling of accomodate
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:29:58 -04:00
Donald Sharp 2ef62909a9 *: Fix spelling of atleast
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:25:03 -04:00
David Lamparter 145e4c38b9 pim6d: include IPv6 pseudoheader in TX checksums
Lots of passing src/dst around, but it is what it is.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 14:13:23 +02:00
Mobashshera Rasool 76bfa0302c pim6d: Parse BSM packet for PIMv6
Modify pim_bsm_process to accomodate v4 and v6 address
for parsing the received packet.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-25 03:57:19 -07:00
Mobashshera Rasool 9dca52b924 pim6d: Modify pim_rp_del for PIMv4/PIMv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool c6ced47492 pim6d: Add pim_get_all_mcast_group api
Added this api to fill all multicast group address based on IP version.
For PIMv4 its 224.0.0.0/4, for PIMv6 its FF00::0/8.
Changed the code where its being used currently.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool 49b7b2c4a8 pim6d: Modify pim_rp_change api for pimv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
David Lamparter 6564f5e5a5 Merge pull request #10657 from patrasar/pim_remove_in_addr_none
[manual merge to edit comment, didn't want to incur another cycle]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-02 10:42:17 +01:00
sarita patra cc144e8b6b pimd: replace inaddr_none with PIMADDR_ANY
We can use PIMADDR_ANY instead of INADDR_NONE to initalize rp->rpf_addr
when there is no rp configured for group_all.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 09:45:56 -08:00
Sai Gomathi N d17b6892fc pim6d: Adding show running for ipv6 mld commands
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Donald Sharp 3bf65aa1ae
Merge pull request #10400 from opensourcerouting/pim6-compilefix
pim6d: get running with ipv6 types throughout
2022-02-26 08:03:06 -05:00
Donald Sharp cc9f21da22 *: Change thread->func to return void instead of int
The int return value is never used.  Modify the code
base to just return a void instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-23 19:56:04 -05:00
David Lamparter 809c11a9d8 pim6d: IPv6-adjust BSM code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-16 16:40:56 +01:00
David Lamparter 29fd9fca45 pim6d: IPv6-adjust pim_msg_send() and related
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter 034db86b72 pim6d: IPv6-adjust iface primary/DR addrs
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter 9bb93fa04e pim6d: IPv6-adjust neigh->source_addr
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter c631920c15 pim6d: IPv6-adjust various pim_sgaddr uses
Since `pim_sgaddr` is `pim_addr` now, that causes a whole lot of fallout
anywhere S,G pairs are handled.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00