From owner-freebsd-current Mon Mar 20 11: 4:18 2000 Delivered-To: freebsd-current@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id 87BE137C2B1 for ; Mon, 20 Mar 2000 11:04:10 -0800 (PST) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.2) id LAA05714; Mon, 20 Mar 2000 11:03:07 -0800 (PST) From: Archie Cobbs Message-Id: <200003201903.LAA05714@bubba.whistle.com> Subject: Re: ICMP socket weirdness In-Reply-To: <200003181954.OAA77677@khavrinen.lcs.mit.edu> from Garrett Wollman at "Mar 18, 2000 02:54:26 pm" To: wollman@khavrinen.lcs.mit.edu (Garrett Wollman) Date: Mon, 20 Mar 2000 11:03:07 -0800 (PST) Cc: freebsd-current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Garrett Wollman writes: > > When the program is run, if you ping the IP address from the > > local machine, it sees packets. However, if you ping it from > > a remote machine, it doesn't see packets. > > The ICMP never passes certain packets up to raw listeners. These > include ECHO REQUEST, TIMESTAMP REQUEST, and SUBNET MASK REQUEST > packets -- but not the corresponding replies! So, when you ping the > local machine, you will see the ECHO REPLY packets on all raw > listners, but not the initial ECHO REQUESTs. When you ping from a > remote machine, you never see the ECHO REQUEST packets because the > kernel takes care of them, and you never see the ECHO REPLY packets > because they are addressed to the other machine. Is this a FreeBSD-specific thing, or to other UNIX's have this same peculiar behavior? > It would be possible to pass all ICMP packets to the raw listeners, > but it would require rewriting parts of icmp_input() (which would not > be a bad idea) either to avoid modifying the packet in-place or to > keep a copy of the original before responding -- either of which would > slow down `ping' processing. The existence of m_dup() makes the latter option a lot easier.. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message