summaryrefslogtreecommitdiff
path: root/pimd/pim_mroute.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_mroute.c')
-rw-r--r--pimd/pim_mroute.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c
index 5f951b4dfc..1978afa7c0 100644
--- a/pimd/pim_mroute.c
+++ b/pimd/pim_mroute.c
@@ -137,7 +137,8 @@ int pim_mroute_msg_nocache(int fd, struct interface *ifp, const kernmsg *msg)
return 0;
}
-int pim_mroute_msg_wholepkt(int fd, struct interface *ifp, const char *buf)
+int pim_mroute_msg_wholepkt(int fd, struct interface *ifp, const char *buf,
+ size_t len)
{
struct pim_interface *pim_ifp;
pim_sgaddr sg;
@@ -229,7 +230,7 @@ int pim_mroute_msg_wholepkt(int fd, struct interface *ifp, const char *buf)
}
pim_register_send((uint8_t *)buf + sizeof(ipv_hdr),
- ntohs(IPV_LEN(ip_hdr)) - sizeof(ipv_hdr),
+ len - sizeof(ipv_hdr),
pim_ifp->primary_address, rpg, 0, up);
}
return 0;
@@ -336,7 +337,8 @@ int pim_mroute_msg_wrongvif(int fd, struct interface *ifp, const kernmsg *msg)
return 0;
}
-int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp, const char *buf)
+int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp, const char *buf,
+ size_t len)
{
const ipv_hdr *ip_hdr = (const ipv_hdr *)buf;
struct pim_interface *pim_ifp;
@@ -463,7 +465,7 @@ int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp, const char *buf)
pim_upstream_keep_alive_timer_start(
up, pim_ifp->pim->keep_alive_time);
pim_upstream_inherited_olist(pim_ifp->pim, up);
- pim_mroute_msg_wholepkt(fd, ifp, buf);
+ pim_mroute_msg_wholepkt(fd, ifp, buf, len);
}
return 0;
}
@@ -490,7 +492,7 @@ int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp, const char *buf)
pim_upstream_mroute_add(up->channel_oil, __func__);
// Send the packet to the RP
- pim_mroute_msg_wholepkt(fd, ifp, buf);
+ pim_mroute_msg_wholepkt(fd, ifp, buf, len);
} else {
up = pim_upstream_add(pim_ifp->pim, &sg, ifp,
PIM_UPSTREAM_FLAG_MASK_SRC_NOCACHE,