pimd: Add some code to intelligently handle WHOLEPKT generation

When we get a NOCACHE call from the kernel, there is
no point generating a mcast route for the packet if
there is no RP configured, or if PIM-SSM is configured
on the interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2015-10-23 07:10:30 -07:00 committed by Donald Sharp
parent e5d33c8377
commit 04b40f027c
3 changed files with 26 additions and 3 deletions

View File

@ -72,6 +72,22 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg
const char *src_str, const char *grp_str)
{
struct mfcctl mc;
struct pim_interface *pim_ifp = ifp->info;
/*
* If the incoming interface is unknown OR
* the Interface type is SSM we don't need to
* do anything here
*/
if ((qpim_rp.s_addr == INADDR_NONE) ||
(!pim_ifp) ||
(pim_ifp->itype == PIM_INTERFACE_SSM))
return 0;
if (PIM_DEBUG_PIM_TRACE) {
zlog_debug("%s: Adding a Route for %s from %s for WHOLEPKT consumption",
__PRETTY_FUNCTION__, grp_str, src_str);
}
/*
* This is just a hack to get the (S,G) received packet up into
@ -92,6 +108,13 @@ static int
pim_mroute_msg_wholepkt (int fd, struct interface *ifp, const struct igmpmsg *msg,
const char *src_str, const char *grp_str)
{
if (qpim_rp.s_addr == INADDR_NONE) {
if (PIM_DEBUG_PIM_TRACE) {
zlog_debug("%s: Received WHOLEPKT with no RP configured to send it to",
__PRETTY_FUNCTION__);
}
}
return 0;
}

View File

@ -45,7 +45,7 @@ pim_rp_check_rp (struct in_addr old, struct in_addr new)
zlog_debug("%s: %s for old %s new %s", __func__, rp, sold, snew );
}
if (qpim_rp.s_addr == 0)
if (qpim_rp.s_addr == INADDR_NONE)
return;
if (new.s_addr == qpim_rp.s_addr)
@ -98,7 +98,7 @@ pim_rp_g (struct in_addr group)
int
pim_rp_set_upstream_addr (struct in_addr *up, struct in_addr source)
{
if ((qpim_rp.s_addr == 0) && (source.s_addr == 0xFFFFFFFF))
if ((qpim_rp.s_addr == INADDR_NONE) && (source.s_addr == 0xFFFFFFFF))
{
if (PIM_DEBUG_PIM_TRACE)
zlog_debug("%s: Received a (*,G) with no RP configured", __PRETTY_FUNCTION__);

View File

@ -69,7 +69,7 @@ int64_t qpim_mroute_add_last = 0;
int64_t qpim_mroute_del_events = 0;
int64_t qpim_mroute_del_last = 0;
struct list *qpim_static_route_list = 0;
struct in_addr qpim_rp;
struct in_addr qpim_rp = { .s_addr = INADDR_NONE };
int32_t qpim_register_suppress_time = PIM_REGISTER_SUPPRESSION_TIME_DEFAULT;
int32_t qpim_register_probe_time = PIM_REGISTER_PROBE_TIME_DEFAULT;