Skip to content

Commit

Permalink
pimd: Fix PIM VRF support (send register/register stop in VRF)
Browse files Browse the repository at this point in the history
In 9461953 and
8ebcc02, transmission of PIM register and
register stop messages was changed to use a separate socket. However, that
socket is not bound to a possible VRF, so the messages were sent in the
default VRF instead. Call vrf_bind() once after socket creation and when the
VRF is ready to ensure transmission in the correct VRF. vrf_bind() handles
the non-VRF case (i.e. VRF_DEFAULT) automatically, so it may be called
unconditionally.

Signed-off-by: Martin Buck <[email protected]>
(cherry picked from commit 5a01011)
  • Loading branch information
gromit1811 authored and mergify[bot] committed Feb 24, 2025
1 parent c3e264e commit e933d37
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pimd/pim_instance.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ static int pim_vrf_enable(struct vrf *vrf)

zlog_debug("%s: for %s %u", __func__, vrf->name, vrf->vrf_id);

if (vrf_bind(vrf->vrf_id, pim->reg_sock, NULL) < 0)
zlog_warn("Failed to bind register socket to VRF %s", vrf->name);

pim_mroute_socket_enable(pim);

FOR_ALL_INTERFACES (vrf, ifp) {
Expand Down

0 comments on commit e933d37

Please sign in to comment.