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>
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>
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>
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>
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>
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>
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>