Commit graph

16 commits

Author SHA1 Message Date
Donald Sharp 5d4c7d2ece
Merge pull request #18675 from mjstapp/fix_clang_18_warnings
lib,pimd,bgpd,bfdd: Fix clang 18 warnings
2025-04-17 18:38:21 -04:00
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
Nathan Bahr 133bb5f614 pimd: Only create and bind the autorp socket when really needed
Previously, the autorp socket would get created and bind if needed
by autorp configuration.
This update limits it further to also require pim enabled interfaces
in the vrf before the socket is created and bind.
So now the socket will automatically close if there are no pim
enabled interfaces left, or if autorp is turned off. It will
automatically turn on if autorp is turned on and there are pim
enabled interfaces in the vrf.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-03-28 16:50:09 +00:00
Donald Sharp 777aae08cf
Merge pull request #18226 from nabahr/pim-vrf-bind
pim: Fix vrf binding of autorp and mroute socket
2025-02-24 13:53:39 -05:00
Nathan Bahr d840560b74 pim: Fix autorp group joins
Group joining got broken when moving the autorp socket to open/close
as needed. This fixes it so autorp group joining is properly handled
as part of opening the socket.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-02-21 21:38:32 +00:00
Nathan Bahr 7e181a771c pim: Fix vrf binding of autorp and mroute socket
Bind the autorp socket to the vrf device.
Also fixed mroute socket to use vrf_bind instead of directly
setting the socket option.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-02-21 19:32:40 +00:00
Nathan Bahr 5d102a0a70 pimd: Close AutoRP socket when not needed
Don't leave the socket open if we are not enabled for discovery
or announcements.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-01-27 17:04:14 +00:00
Donald Sharp 37b88191fb pimd: Prevent crash of pim when auto-rp's socket is not initialized
If the socket associated with the auto-rp fails to initialize then
the memory for the auto-rp is just dropped on the floor.  Additionally
any type of attempt at using the feature will just cause pimd to crash,
when the pointer is derefed.  Since it is derefed all over the place
without checking.

Clearly if you cannot bind/use the socket let's allow continuation.

Fixes: #17540
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-04 10:49:49 -05:00
Nathan Bahr b6aa71b59b pimd: Implement autorp mapping agent
Fully flushed out the AutoRP implementation now with the AutoRP mapping agent.
This touched most of AutoRP in order to have common reuse of containers for each
section of AutoRP operation (Candidate RP announcement, Mapping agent, Discovery).
Many debugs had guards added and many more debug logs added.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-11-19 22:33:11 +00:00
Nathan Bahr 433fce647c pimd: PIM autorp no path RP fix
Just because there is currently no path to the RP doesn't mean it failed to add.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-10-23 19:10:47 +00:00
David Lamparter 3ce0fe0e08 pimd: initialize prefix value in Auto-RP
clang-SA complains that it's only partially initialized (because it's
used with IPv4 only).  The code later calls some AF-generic code,
prompting clang-SA to complain that the non-IPv4 parts are used without
being set.  While this shouldn't happen, just initialize it fully.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-10-16 13:30:25 +02:00
Jafar Al-Gharaibeh a49acba1d4 pimd: fix a possible crash when enabling debug autorp
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-10-07 18:22:06 -05:00
Barry A. Trent ba4555c646 pimd: fix autorp CLI bugs
Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
2024-09-27 13:39:30 -07:00
Nathan Bahr 3e6cc0d0f1 pimd: Fix coverity checked return issue
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-09-25 13:56:30 +00:00
Nathan Bahr 54bc821a2a pimd: Fix coverity checked return issue
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-09-25 13:55:31 +00:00
Nathan Bahr f182255c0f pimd: Add AutoRP functionality to PIMD
Perform AutoRP discovery and candidate RP announcements using the
AutoRP protocol.
Mapping agent is not yet implemented, but this feature is not
necessary for FRR to support AutoRP as we only need one AutoRP
mapping agent in the network.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-09-24 16:36:53 +00:00