From owner-freebsd-net@FreeBSD.ORG Wed Jan 10 19:42:44 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4F1D16A416 for ; Wed, 10 Jan 2007 19:42:44 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by mx1.freebsd.org (Postfix) with ESMTP id 8D2D413C44C for ; Wed, 10 Jan 2007 19:42:44 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out1.internal (unknown [10.202.2.149]) by out1.messagingengine.com (Postfix) with ESMTP id AF876757E5; Wed, 10 Jan 2007 14:36:22 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by out1.internal (MEProxy); Wed, 10 Jan 2007 14:36:22 -0500 X-Sasl-enc: 41HSIYC0UjHTvDsKCy+nMLOzB4DRqnG8EFkwYH6J7/01 1168457782 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id C0D07169B5; Wed, 10 Jan 2007 14:36:20 -0500 (EST) Message-ID: <45A54119.20809@FreeBSD.org> Date: Wed, 10 Jan 2007 19:40:09 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 1.5.0.5 (X11/20060825) MIME-Version: 1.0 To: Eygene Ryabinkin References: <459D4D88.2030708@delphij.net> <459FEDBC.4070008@FreeBSD.org> <20070107115158.GA63854@codelabs.ru> In-Reply-To: <20070107115158.GA63854@codelabs.ru> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, LI Xin Subject: Re: Different behavior of ping'ing INADDR_BROADCAST? 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: Wed, 10 Jan 2007 19:42:44 -0000 Eygene Ryabinkin wrote: > > For me the routing gives the default gateway as the next hop, so the 'dst' > will be rewritten at the line 241. > You're quite right, I stand corrected -- the undirected broadcast case is hitting the default route. > I think that this confirms my findings. Have you tried to look at your packet > with tcpdump? Link-level MAC should be set to your routers one, not to yhe > 0xffffffff. > I saw this as well. The behaviour is actually as expected. FreeBSD has done this for years. Some years ago I did some work on a fix for this, but it was not net-smp safe. Wes Peters suggested treating INADDR_BROADCAST traffic like multicast-routed traffic. Whilst the MROUTING code has queues for each entry in the Multicast Forwarding Cache (MFC) and knows how to dispatch the same mbuf chain more than once, it isn't compiled in by default. Regards BMS