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.
This commit is contained in:
Garrett Wollman 1997-08-25 16:29:27 +00:00
parent 0755ef0eea
commit fe0fb8abd0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28723
2 changed files with 9 additions and 2 deletions

View File

@ -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 */
};
/*

View File

@ -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 <sys/param.h>
@ -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;