summaryrefslogtreecommitdiffstats
path: root/pimd/pim_sock.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-02-07 15:52:52 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2017-02-07 15:52:52 +0100
commitf6864de1ab4251eeaae4657da341b2d423785fc1 (patch)
treea18df33470896ab1f8a640ee686c6aa9029d21ba /pimd/pim_sock.c
parentMerge branch 'frr/pull/166' ("bgpd: fix array oob ...") (diff)
parentpimd: Refactor pim_sock_open to just need the ifp pointer (diff)
downloadfrr-f6864de1ab4251eeaae4657da341b2d423785fc1.tar.xz
frr-f6864de1ab4251eeaae4657da341b2d423785fc1.zip
Merge branch 'frr/pull/165' ("Pim vrf")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
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 df0095d29..7f62a1e9d 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)
@@ -223,7 +220,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