summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1998-05-26 11:34:30 +0000
committerdg <dg@FreeBSD.org>1998-05-26 11:34:30 +0000
commite3df194a9fc33ef83cfffe3126ebaae0659812cf (patch)
treee132119fd903f2ad117125b6fe91ffde58bfa43a /sys/netinet
parent31e5866c45722c2597f3b1b4ef7a9a731bfdd288 (diff)
downloadFreeBSD-src-e3df194a9fc33ef83cfffe3126ebaae0659812cf.zip
FreeBSD-src-e3df194a9fc33ef83cfffe3126ebaae0659812cf.tar.gz
Fixed logic in the test to drop ICMP echo and timestamp packets when
net.inet.ip.icmp.bmcastecho = 0 by removing the extra check for the address being a multicast address. The test now relies on the link layer flags that indicate it was received via multicast. The previous logic was broken and replied to ICMP echo/timestamp broadcasts even when the sysctl option disallowed them. Reviewed by: wollman
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_icmp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 088bf58..1858c15 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.28 1997/08/25 01:25:31 wollman Exp $
+ * $Id: ip_icmp.c,v 1.29 1997/08/25 16:29:27 wollman Exp $
*/
#include <sys/param.h>
@@ -375,8 +375,7 @@ icmp_input(m, hlen)
case ICMP_ECHO:
if (!icmpbmcastecho
- && (m->m_flags & (M_MCAST | M_BCAST)) != 0
- && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
+ && (m->m_flags & (M_MCAST | M_BCAST)) != 0) {
icmpstat.icps_bmcastecho++;
break;
}
@@ -385,8 +384,7 @@ icmp_input(m, hlen)
case ICMP_TSTAMP:
if (!icmpbmcastecho
- && (m->m_flags & (M_MCAST | M_BCAST)) != 0
- && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
+ && (m->m_flags & (M_MCAST | M_BCAST)) != 0) {
icmpstat.icps_bmcasttstamp++;
break;
}
OpenPOWER on IntegriCloud