summaryrefslogtreecommitdiffstats
path: root/pimd/pim_sock.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-02-03 18:33:37 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-02-03 18:33:37 +0100
commitb35702d0b8367fc719bb57ab211e3495091612b9 (patch)
treea13adaf5e180bdbd6a5664ad05b6b478beb68101 /pimd/pim_sock.c
parentMerge pull request #159 from LabNConsulting/working/master/patch-set/rfapi+vty (diff)
downloadfrr-b35702d0b8367fc719bb57ab211e3495091612b9.tar.xz
frr-b35702d0b8367fc719bb57ab211e3495091612b9.zip
pimd: Allow a interface in a vrf to be configured.
This fixes the issue a crash when we have configured an interface inside of a vrf, and apply pim commands to it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_sock.c')
-rw-r--r--pimd/pim_sock.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c
index 11cd61b59..6e7837af4 100644
--- a/pimd/pim_sock.c
+++ b/pimd/pim_sock.c
@@ -111,7 +111,7 @@ pim_socket_bind (int fd, struct interface *ifp)
return ret;
}
-int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, u_char loop)
+int pim_socket_mcast(int protocol, struct in_addr ifaddr, struct interface *ifp, u_char loop)
{
int rcvbuf = 1024 * 1024 * 8;
#ifdef HAVE_STRUCT_IP_MREQN_IMR_IFINDEX
@@ -132,9 +132,6 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, u_char lo
if (protocol == IPPROTO_PIM)
{
int ret;
- struct interface *ifp = NULL;
-
- ifp = if_lookup_by_index_vrf (ifindex, VRF_DEFAULT);
ret = pim_socket_bind (fd, ifp);
if (ret)
@@ -222,7 +219,7 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, u_char lo
memset (&mreq, 0, sizeof (mreq));
#ifdef HAVE_STRUCT_IP_MREQN_IMR_IFINDEX
- mreq.imr_ifindex = ifindex;
+ mreq.imr_ifindex = ifp->ifindex;
#else
/*
* I am not sure what to do here yet for *BSD