Re: icmp echo_user



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,

I am a Google Summer of Code student working on mtund, aka Magic
Tunnel Daemon aka Super Tunnel Daemon,
http://wiki.freebsd.org/SuperTunnelDaemon.

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.

Matus

patch:
Index: ip_icmp.c
===================================================================
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, "");

+static int icmpechouser = 0;
+SYSCTL_INT(_net_inet_icmp, OID_AUTO, echo_user, CTLFLAG_RW | CTLFLAG_SECURE,
+ &icmpechouser, 0, "Pass ICMP echo requests to userspace rather than"
+ "replying to them in the kernel");

#ifdef ICMPPRINTFS
int icmpprintfs = 0;
@@ -454,6 +458,9 @@
break;

case ICMP_ECHO:
+ if (icmpechouser)
+ goto raw;
+
if (!icmpbmcastecho
&& (m->m_flags & (M_MCAST | M_BCAST)) != 0) {
icmpstat.icps_bmcastecho++;


Attachment: pgp58qBqiH1uv.pgp
Description: PGP signature



Relevant Pages

  • Re: [PATCH] uio: User IRQ Mode
    ... In this mode the user space driver ... is responsible for acknowledging and re-enabling the interrupt. ... This can easily be done without your patch. ...
    (Linux-Kernel)
  • [PATCH] Futex: Revert the non-functional REQUEUE_PI
    ... introduced user space visible changes to the futex syscall. ... The patch is non-functional and there is no way to fix it proper before ... Verified against the glibc tests and my own PI futex tests. ... struct inode *inode; ...
    (Linux-Kernel)
  • Re: [PATCH] x86: clean up process_32/64.c
    ... conflicted with your patch, so parts of your patch did not apply. ... -static void poll_idle ... Capture the user space registers if the task is not running ... * Capture the user space registers if the task is not running ...
    (Linux-Kernel)
  • RE: [PATCH]kprobe handler discard user space trap
    ... kprobe handler discard user space trap ... This patch removes code in kprobe_handlerfunction which calculates ... int ret = NOTIFY_DONE; ...
    (Linux-Kernel)
  • icmp echo_user
    ... I am a Google Summer of Code student working on mtund, ... Tunnel Daemon aka Super Tunnel Daemon, ... For this being able to receive ICMP echo requests in the user ...
    (freebsd-net)