From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 19 17:25:00 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 927571065675; Tue, 19 Jul 2011 17:25:00 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 3B4A48FC0A; Tue, 19 Jul 2011 17:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=r4BBFeN+uFRA8/dKCD4KHhhRNaIYiRCRqNA7BEYVp4c=; b=p5ScyJreiVXk5U7jZuoQAi1MgcEfoqAmOGvnDtBg2Jn7y+EktWbFcckbLe2pXUJ4fnBXqyIXaQvVfMNMEBB15tleqnQg6n5wbQ523Tb63No2BZ8/2hALr9+6/KEYAh2Q1x4/bqiUX9PtDZB1v5WnVy/Q1+zlnrIsb95wU9x5f4/ZXlQwWXi0Thi/P9smmaBYLXMnhRRvWkpvfjjdSEJU/MIz/NeBR4pLnVzI98ELowRiXRacsIrTxqH1LvxkmKU7EGNT/3VXjOUFjdH01UJYlOkacCLcXff5C1QnrSno0ZPpJ9DzkGBvfNhrJIQye8EGLeVCnPLOvVt7QaLP2K7oWg==; Received: from MacBook-Eygene-Ryabinkin.local (ppp91-77-162-156.pppoe.mtu-net.ru [91.77.162.156]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1QjE2U-000OfO-PD; Tue, 19 Jul 2011 21:24:58 +0400 Date: Tue, 19 Jul 2011 21:24:55 +0400 From: Eygene Ryabinkin To: Daniel Braniss Message-ID: <20110719172455.GP54929@MacBook-Eygene-Ryabinkin.local> References: <20110718203215.GM54929@MacBook-Eygene-Ryabinkin.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NEaRsfQExFH3jWtg" Content-Disposition: inline In-Reply-To: Sender: rea@codelabs.ru Cc: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: broadcast oddity X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 17:25:00 -0000 --NEaRsfQExFH3jWtg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Tue, Jul 19, 2011 at 10:40:11AM +0300, Daniel Braniss wrote: > > And that non-broadcast ethernet address is the MAC of your > > default router? > yes. Fine, that is more-or-less expected, since the network subsystem just routes 255.255.255.255 to the default gateway. The issue you're seeing were already seen before, http://lists.freebsd.org/pipermail/freebsd-net/2005-October/008626.html http://www.freebsd.org/cgi/query-pr.cgi?pr=3D72468 http://lists.freebsd.org/pipermail/freebsd-net/2007-January/012874.html [= 1] and bms@ told me that in this case the default gateway routing is the correct historical behaviour of FreeBSD. [1] I finally remembered that I had seen this issue too ;)) > > What's your routing table (netstat -rn) for the PXE-booted host? > > it's ok, same in both cases. it's picked up via DHCP, in the diskless > case by the boot/loader in the second via dhcpclient. Still, can you show both of them? > > You nailed it: you should send packets to the network's broadcast, > > not to the 0xffffffff. > >=20 > but I'm at the user/ip level!, have no way to set mac/ethernet address. I meant the IP's network broadcast and by 0xffffffff I meant 255.255.255.255. Please, look at the posted code. > still, the question is why it works in one case, and failes in the other. Yes, it is. But ip_output.c has the following code, {{{ if (rte->rt_flags & RTF_GATEWAY) dst =3D (struct sockaddr_in *)rte->rt_gateway; if (rte->rt_flags & RTF_HOST) isbroadcast =3D (rte->rt_flags & RTF_BROADCAST); else isbroadcast =3D in_broadcast(dst->sin_addr, ifp); }}} So, if the route that is selected is the gateway, then there will be no broadcast on the L2. At least in my understanding of the code. Thus, I am interested in the routing tables and route flags. --=20 Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] --NEaRsfQExFH3jWtg Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iF4EAREIAAYFAk4lvecACgkQFq+eroFS7PtqOwEAkdzoSVbsOv1x01hTfYMQHmN5 sooNn8einiX32BR/PSEA/iJAOVvMn38joKNp8hCxLFUuzm34zc1XLGMSrlnh0B8U =zEhc -----END PGP SIGNATURE----- --NEaRsfQExFH3jWtg--