summaryrefslogtreecommitdiffstats
path: root/pimd/pim_mroute.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-05-11 03:44:25 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 19:51:34 +0200
commit405d63578ac68ad766cb90a63773d7255a15ec06 (patch)
treee993c74da8cb09799e016d5e3c91429b61686cef /pimd/pim_mroute.c
parentpimd: Move thread read to struct pim_instance (diff)
downloadfrr-405d63578ac68ad766cb90a63773d7255a15ec06.tar.xz
frr-405d63578ac68ad766cb90a63773d7255a15ec06.zip
pimd: Convert upcalls from kernel to use appropriate pim instance
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_mroute.c')
-rw-r--r--pimd/pim_mroute.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c
index 0e3ac3a6b..2f6858ea8 100644
--- a/pimd/pim_mroute.c
+++ b/pimd/pim_mroute.c
@@ -508,7 +508,8 @@ static int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp,
return 0;
}
-int pim_mroute_msg(int fd, const char *buf, int buf_size)
+static int pim_mroute_msg(struct pim_instance *pim, const char *buf,
+ int buf_size)
{
struct interface *ifp;
struct pim_interface *pim_ifp;
@@ -531,7 +532,7 @@ int pim_mroute_msg(int fd, const char *buf, int buf_size)
* the source
* of the IP packet.
*/
- ifp = pim_if_lookup_address_vrf(ip_hdr->ip_src, pimg->vrf_id);
+ ifp = pim_if_lookup_address_vrf(ip_hdr->ip_src, pim->vrf_id);
if (!ifp) {
if (PIM_DEBUG_MROUTE_DETAIL) {
@@ -594,24 +595,27 @@ int pim_mroute_msg(int fd, const char *buf, int buf_size)
"%s: pim kernel upcall %s type=%d ip_p=%d from fd=%d for (S,G)=(%s,%s) on %s vifi=%d size=%d",
__PRETTY_FUNCTION__,
igmpmsgtype2str[msg->im_msgtype],
- msg->im_msgtype, ip_hdr->ip_p, fd, src_str,
- grp_str, ifp->name, msg->im_vif, buf_size);
+ msg->im_msgtype, ip_hdr->ip_p,
+ pim->mroute_socket, src_str, grp_str, ifp->name,
+ msg->im_vif, buf_size);
}
switch (msg->im_msgtype) {
case IGMPMSG_WRONGVIF:
- return pim_mroute_msg_wrongvif(fd, ifp, msg);
+ return pim_mroute_msg_wrongvif(pim->mroute_socket, ifp,
+ msg);
break;
case IGMPMSG_NOCACHE:
- return pim_mroute_msg_nocache(fd, ifp, msg);
+ return pim_mroute_msg_nocache(pim->mroute_socket, ifp,
+ msg);
break;
case IGMPMSG_WHOLEPKT:
- return pim_mroute_msg_wholepkt(fd, ifp,
+ return pim_mroute_msg_wholepkt(pim->mroute_socket, ifp,
(const char *)msg);
break;
case IGMPMSG_WRVIFWHOLE:
- return pim_mroute_msg_wrvifwhole(fd, ifp,
- (const char *)msg);
+ return pim_mroute_msg_wrvifwhole(
+ pim->mroute_socket, ifp, (const char *)msg);
break;
default:
break;
@@ -649,7 +653,7 @@ static int mroute_read(struct thread *t)
goto done;
}
- result = pim_mroute_msg(pim->mroute_socket, buf, rd);
+ result = pim_mroute_msg(pim, buf, rd);
count++;
if (count % qpim_packet_process == 0)
@@ -715,13 +719,13 @@ int pim_mroute_socket_disable(struct pim_instance *pim)
if (pim_mroute_set(pim, 0)) {
zlog_warn(
"Could not disable mroute on socket fd=%d: errno=%d: %s",
- pimg->mroute_socket, errno, safe_strerror(errno));
+ pim->mroute_socket, errno, safe_strerror(errno));
return -2;
}
if (close(pim->mroute_socket)) {
zlog_warn("Failure closing mroute socket: fd=%d errno=%d: %s",
- pimg->mroute_socket, errno, safe_strerror(errno));
+ pim->mroute_socket, errno, safe_strerror(errno));
return -3;
}