From owner-svn-src-all@FreeBSD.ORG Wed Oct 1 18:07:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E658B0B; Wed, 1 Oct 2014 18:07:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10697DFD; Wed, 1 Oct 2014 18:07:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s91I7ZMA023625; Wed, 1 Oct 2014 18:07:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91I7ZdN023619; Wed, 1 Oct 2014 18:07:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201410011807.s91I7ZdN023619@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 1 Oct 2014 18:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272378 - in head: share/man/man4 sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2014 18:07:36 -0000 Author: markj Date: Wed Oct 1 18:07:34 2014 New Revision: 272378 URL: https://svnweb.freebsd.org/changeset/base/272378 Log: Add a sysctl, net.inet.icmp.tstamprepl, which can be used to disable replies to ICMP Timestamp packets. PR: 193689 Submitted by: Anthony Cornehl MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/icmp.4 head/sys/netinet/ip_icmp.c Modified: head/share/man/man4/icmp.4 ============================================================================== --- head/share/man/man4/icmp.4 Wed Oct 1 17:16:18 2014 (r272377) +++ head/share/man/man4/icmp.4 Wed Oct 1 18:07:34 2014 (r272378) @@ -28,7 +28,7 @@ .\" @(#)icmp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 9, 2007 +.Dd September 30, 2014 .Dt ICMP 4 .Os .Sh NAME @@ -216,6 +216,10 @@ instead of the possibly different return Number of bytes from original packet to quote in ICMP reply. This number is internally enforced to be at least 8 bytes (per RFC792) and at most the maximal space left in the ICMP reply mbuf. +.It Va tstamprepl +.Pq Vt boolean +Enable/disable replies to ICMP Timestamp packets. +Defaults to true. .El .Sh ERRORS A socket operation may fail with one of the following errors returned: Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Wed Oct 1 17:16:18 2014 (r272377) +++ head/sys/netinet/ip_icmp.c Wed Oct 1 18:07:34 2014 (r272378) @@ -149,6 +149,10 @@ SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO &VNET_NAME(icmpbmcastecho), 0, ""); +static VNET_DEFINE(int, icmptstamprepl) = 1; +#define V_icmptstamprepl VNET(icmptstamprepl) +SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFLAG_RW, + &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets"); #ifdef ICMPPRINTFS int icmpprintfs = 0; @@ -545,6 +549,8 @@ icmp_input(struct mbuf **mp, int *offp, goto reflect; case ICMP_TSTAMP: + if (V_icmptstamprepl == 0) + break; if (!V_icmpbmcastecho && (m->m_flags & (M_MCAST | M_BCAST)) != 0) { ICMPSTAT_INC(icps_bmcasttstamp);