From fe0fb8abd09d4adf59261226e67e8dd58ecfd281 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Mon, 25 Aug 1997 16:29:27 +0000 Subject: [PATCH] ICMP Timestamp Request messages could have harbored the same sort of problem as Echo Requests when broad/multicast. When multicast echo responses are disabled, also do the same for timestamp responses. --- sys/netinet/icmp_var.h | 3 ++- sys/netinet/ip_icmp.c | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/netinet/icmp_var.h b/sys/netinet/icmp_var.h index 68d11876605f..cb8af60c3769 100644 --- a/sys/netinet/icmp_var.h +++ b/sys/netinet/icmp_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)icmp_var.h 8.1 (Berkeley) 6/10/93 - * $Id: icmp_var.h,v 1.6 1997/02/22 09:41:24 peter Exp $ + * $Id: icmp_var.h,v 1.7 1997/08/25 01:25:29 wollman Exp $ */ #ifndef _NETINET_ICMP_VAR_H_ @@ -55,6 +55,7 @@ struct icmpstat { u_long icps_reflect; /* number of responses */ u_long icps_inhist[ICMP_MAXTYPE + 1]; u_long icps_bmcastecho; /* b/mcast echo requests dropped */ + u_long icps_bmcasttstamp; /* b/mcast tstamp requests dropped */ }; /* diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index e948b4be5a5d..088bf5813d70 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.27 1997/08/02 14:32:53 bde Exp $ + * $Id: ip_icmp.c,v 1.28 1997/08/25 01:25:31 wollman Exp $ */ #include @@ -384,6 +384,12 @@ icmp_input(m, hlen) goto reflect; case ICMP_TSTAMP: + if (!icmpbmcastecho + && (m->m_flags & (M_MCAST | M_BCAST)) != 0 + && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { + icmpstat.icps_bmcasttstamp++; + break; + } if (icmplen < ICMP_TSLEN) { icmpstat.icps_badlen++; break;