summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_mroute.c
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2007-02-10 14:48:42 +0000
committerbms <bms@FreeBSD.org>2007-02-10 14:48:42 +0000
commit17b1800be231f6a8ab9fbb44d8d9c2557d8316e9 (patch)
treecead2eccea85bff33b0ce5cdba824ac651beb1b3 /sys/netinet/ip_mroute.c
parent42ce6b97cf4944025f5baa95924e300d134245e9 (diff)
downloadFreeBSD-src-17b1800be231f6a8ab9fbb44d8d9c2557d8316e9.zip
FreeBSD-src-17b1800be231f6a8ab9fbb44d8d9c2557d8316e9.tar.gz
If the rendezvous point for a group is not specified, do not send
IGMPMSG_WHOLEPKT notifications to the userland PIM routing daemon, as an optimization to mitigate the effects of high multicast forwarding load. This is an experimental change, therefore it must be explicitly enabled by setting the sysctl/tunable net.inet.pim.squelch_wholepkt to a non-zero value. The tunable may be set from the loader or from within the kernel environment when loading ip_mroute.ko as a module. Submitted by: edrt <edrt at citiz.net> See also: http://mailman.icsi.berkeley.edu/pipermail/xorp-users/2005-June/000639.html
Diffstat (limited to 'sys/netinet/ip_mroute.c')
-rw-r--r--sys/netinet/ip_mroute.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 6a50ef0..2f38d5e 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -200,6 +200,11 @@ SYSCTL_STRUCT(_net_inet_pim, PIMCTL_STATS, stats, CTLFLAG_RD,
&pimstat, pimstat,
"PIM Statistics (struct pimstat, netinet/pim_var.h)");
+static u_long pim_squelch_wholepkt = 0;
+SYSCTL_ULONG(_net_inet_pim, OID_AUTO, squelch_wholepkt, CTLFLAG_RW,
+ &pim_squelch_wholepkt, 0,
+ "Disable IGMP_WHOLEPKT notifications if rendezvous point is unspecified");
+
extern struct domain inetdomain;
struct protosw in_pim_protosw = {
.pr_type = SOCK_RAW,
@@ -2522,6 +2527,14 @@ pim_register_send(struct ip *ip, struct vif *vifp,
if (mrtdebug & DEBUG_PIM)
log(LOG_DEBUG, "pim_register_send: ");
+ /*
+ * Do not send IGMP_WHOLEPKT notifications to userland, if the
+ * rendezvous point was unspecified, and we were told not to.
+ */
+ if (pim_squelch_wholepkt != 0 && (mrt_api_config & MRT_MFC_RP) &&
+ (rt->mfc_rp.s_addr == INADDR_ANY))
+ return 0;
+
mb_copy = pim_register_prepare(ip, m);
if (mb_copy == NULL)
return ENOBUFS;
@@ -2991,6 +3004,8 @@ ip_mroute_modevent(module_t mod, int type, void *unused)
MFC_LOCK_INIT();
VIF_LOCK_INIT();
ip_mrouter_reset();
+ TUNABLE_ULONG_FETCH("net.inet.pim.squelch_wholepkt",
+ &pim_squelch_wholepkt);
pim_encap_cookie = encap_attach_func(AF_INET, IPPROTO_PIM,
pim_encapcheck, &in_pim_protosw, NULL);
if (pim_encap_cookie == NULL) {
OpenPOWER on IntegriCloud