From e3df194a9fc33ef83cfffe3126ebaae0659812cf Mon Sep 17 00:00:00 2001 From: dg Date: Tue, 26 May 1998 11:34:30 +0000 Subject: 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 --- sys/netinet/ip_icmp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys') 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 @@ -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; } -- cgit v1.1