Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 May 2021 10:37:33 GMT
From:      Wojciech Macek <wma@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0b103f72376b - main - mrouter: do not loopback packets unconditionally
Message-ID:  <202105111037.14BAbXtl090541@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by wma:

URL: https://cgit.FreeBSD.org/src/commit/?id=0b103f72376b5ec7c9a9d574c976e42805ae88a4

commit 0b103f72376b5ec7c9a9d574c976e42805ae88a4
Author:     Wojciech Macek <wma@FreeBSD.org>
AuthorDate: 2021-04-23 06:49:27 +0000
Commit:     Wojciech Macek <wma@FreeBSD.org>
CommitDate: 2021-05-11 10:36:07 +0000

    mrouter: do not loopback packets unconditionally
    
    Looping back router multicast traffic signifficantly
    stresses network stack. Add possibility to disable or enable
    loopbacked based on sysctl value.
    
    Reported by:    Daniel Deville
    Reviewed by:    mw
    Differential Revision:  https://reviews.freebsd.org/D29947
---
 sys/netinet/ip_mroute.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 8ecc983ea58f..b8e677ba9af1 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -244,6 +244,8 @@ static const struct encaptab *pim_encap_cookie;
 static int pim_encapcheck(const struct mbuf *, int, int, void *);
 static int pim_input(struct mbuf *, int, int, void *);
 
+extern int in_mcast_loop;
+
 static const struct encap_config ipv4_encap_cfg = {
 	.proto = IPPROTO_PIM,
 	.min_length = sizeof(struct ip) + PIM_MINLEN,
@@ -1685,7 +1687,7 @@ send_packet(struct vif *vifp, struct mbuf *m)
 
 	imo.imo_multicast_ifp  = vifp->v_ifp;
 	imo.imo_multicast_ttl  = mtod(m, struct ip *)->ip_ttl - 1;
-	imo.imo_multicast_loop = 1;
+	imo.imo_multicast_loop = !!in_mcast_loop;
 	imo.imo_multicast_vif  = -1;
 	STAILQ_INIT(&imo.imo_head);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105111037.14BAbXtl090541>