Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jul 2011 21:24:55 +0400
From:      Eygene Ryabinkin <rea@freebsd.org>
To:        Daniel Braniss <danny@cs.huji.ac.il>
Cc:        freebsd-net@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: broadcast oddity
Message-ID:  <20110719172455.GP54929@MacBook-Eygene-Ryabinkin.local>
In-Reply-To: <E1Qj4uZ-0005nH-SR@kabab.cs.huji.ac.il>
References:  <E1QioQt-000MJQ-T9@kabab.cs.huji.ac.il> <20110718203215.GM54929@MacBook-Eygene-Ryabinkin.local> <E1Qj4uZ-0005nH-SR@kabab.cs.huji.ac.il>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110719172455.GP54929>