diff options
author | wollman <wollman@FreeBSD.org> | 1997-08-25 01:25:31 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1997-08-25 01:25:31 +0000 |
commit | dbffeebf4dd746dc49dd8896c7c2a189b2cb589d (patch) | |
tree | de7d2eff4b6fe76570f42216730e4aea2fc1e9e4 /sys/netinet/ip_icmp.c | |
parent | fe1bc8105f27b1325591bddd9d35f84db53653e4 (diff) | |
download | FreeBSD-src-dbffeebf4dd746dc49dd8896c7c2a189b2cb589d.zip FreeBSD-src-dbffeebf4dd746dc49dd8896c7c2a189b2cb589d.tar.gz |
Configurably don't reply to broadcast or multicast echos. There are still
potential problems with other automatic-reply ICMPs, but some of them may
depend on broadcast/multicast to operate. (This code can simply be
moved to the `reflect' label to generalize it.)
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r-- | sys/netinet/ip_icmp.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 3166dd8..e948b4b 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_icmp.c,v 1.26 1997/05/23 22:33:16 julian Exp $ + * $Id: ip_icmp.c,v 1.27 1997/08/02 14:32:53 bde Exp $ */ #include <sys/param.h> @@ -69,6 +69,10 @@ static int icmpmaskrepl = 0; SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW, &icmpmaskrepl, 0, ""); +static int icmpbmcastecho = 1; +SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, &icmpbmcastecho, + 0, ""); + #ifdef ICMPPRINTFS int icmpprintfs = 0; #endif @@ -370,6 +374,12 @@ icmp_input(m, hlen) break; case ICMP_ECHO: + if (!icmpbmcastecho + && (m->m_flags & (M_MCAST | M_BCAST)) != 0 + && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { + icmpstat.icps_bmcastecho++; + break; + } icp->icmp_type = ICMP_ECHOREPLY; goto reflect; |