From owner-freebsd-net@FreeBSD.ORG Fri Oct 26 15:43:36 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9690A16A417 for ; Fri, 26 Oct 2007 15:43:36 +0000 (UTC) (envelope-from matus.harvan@inf.ethz.ch) Received: from xsmtp1.ethz.ch (xsmtp1.ethz.ch [82.130.70.13]) by mx1.freebsd.org (Postfix) with ESMTP id 25C2313C4BD for ; Fri, 26 Oct 2007 15:43:35 +0000 (UTC) (envelope-from matus.harvan@inf.ethz.ch) Received: from xfe0.d.ethz.ch ([82.130.124.40]) by xsmtp1.ethz.ch with Microsoft SMTPSVC(6.0.3790.3959); Fri, 26 Oct 2007 17:31:29 +0200 Received: from styx.inf.ethz.ch ([129.132.74.245]) by xfe0.d.ethz.ch over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 26 Oct 2007 17:31:29 +0200 Received: by styx.inf.ethz.ch (Postfix, from userid 1001) id 0E65349AC70; Fri, 26 Oct 2007 17:31:29 +0200 (CEST) Date: Fri, 26 Oct 2007 17:31:28 +0200 From: Matus Harvan To: freebsd-net@freebsd.org Message-ID: <20071026153128.GF1049@styx.ethz.ch> References: <20070909201152.GA18039@inf.ethz.ch> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="udcq9yAoWb9A4FsZ" Content-Disposition: inline In-Reply-To: <20070909201152.GA18039@inf.ethz.ch> User-Agent: Mutt/1.5.16 (2007-06-09) X-OriginalArrivalTime: 26 Oct 2007 15:31:29.0423 (UTC) FILETIME=[477AA9F0:01C817E5] Cc: Max Laier , Brooks Davis Subject: Re: icmp echo_user X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2007 15:43:36 -0000 --udcq9yAoWb9A4FsZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I was wondering if I could get some feedback about the patch and whether others think it could be committed. Matus On Sun, Sep 09, 2007 at 10:11:52PM +0200, Matus Harvan wrote: > Hello, >=20 > I am a Google Summer of Code student working on mtund, aka Magic > Tunnel Daemon aka Super Tunnel Daemon, > http://wiki.freebsd.org/SuperTunnelDaemon. >=20 > For mtund it would be useful to tunnel in ICMP echo request/reply > pairs. For this being able to receive ICMP echo requests in the user > space would be helpful. Currently, ICMP echo requests are processed in > the kernel where an ICMP echo reply is generated, but they are not > passed to the user space. I would suggest the patch below, adding a > sysctl variable net.inet.icmp.echo_user, allowing to recevie the ICMP > echo requests in the user space on a raw IP/ICMP socket rather than > having the kernel generate a reply to them. >=20 > Matus >=20 > patch: > Index: ip_icmp.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /home/ncvs/src/sys/netinet/ip_icmp.c,v > retrieving revision 1.117 > diff -d -u -r1.117 ip_icmp.c > --- ip_icmp.c 19 Jul 2007 22:34:25 -0000 1.117 > +++ ip_icmp.c 6 Sep 2007 21:26:08 -0000 > @@ -124,6 +124,10 @@ > SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, > &icmpbmcastecho, 0, ""); > =20 > +static int icmpechouser =3D 0; > +SYSCTL_INT(_net_inet_icmp, OID_AUTO, echo_user, CTLFLAG_RW | CTLFLAG_SEC= URE, > + &icmpechouser, 0, "Pass ICMP echo requests to userspace rather t= han" > + "replying to them in the kernel"); > =20 > #ifdef ICMPPRINTFS > int icmpprintfs =3D 0; > @@ -454,6 +458,9 @@ > break; > =20 > case ICMP_ECHO: > + if (icmpechouser) > + goto raw; > + > if (!icmpbmcastecho > && (m->m_flags & (M_MCAST | M_BCAST)) !=3D 0) { > icmpstat.icps_bmcastecho++; --udcq9yAoWb9A4FsZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHIghQ43LQWDWf0QIRAgC6AKCTCw86bh+Tv7Vfv6COXD13uQkq2gCggvK1 Ygf/tfXkHp7fmO1dKvD/4yw= =JQbN -----END PGP SIGNATURE----- --udcq9yAoWb9A4FsZ--