Different behavior of ping'ing INADDR_BROADCAST?

Eygene Ryabinkin rea-fbsd at codelabs.ru
Fri Jan 5 03:34:52 PST 2007

Li, good day!

> By ping'ing from FreeBSD (mostly RELENG_6 with some
> unrelated patches) or Mac OS X, I got response from another subnet (I
> guess that there is some configuration problem in the network, though),
> but no boxes (running various operating systems) on local network
> responds the ping.
> However, with OpenBSD, Linux and Windows, ping'ing would
> get response from local network.

I can provide an insight into the packets seen, but no real explanation
if thigs should go that way at this time.

When FBSD is pinging 0xffffffff it does not use the Ethernet broadcasts,
when the link-level destination MAC is set to 0xffffffffffff, using some
'known MAC' instead. For the network broadcast address -- it does use
link-level broadcasts.

For me the 'known MAC' is that of our border router that serves as
the default destination. And my box doing the ARP request for the
precisely the IP of the router before pinging You can
try to empty your ARP table and then ping watching
for the ARP requests and the link-level header of the ICMP packets.

> Just curious why there is such difference.  Literally, I think
> INADDR_BROADCAST is supposed to reach local network nodes, no?

I should have a look into the sources -- may be there are some hints
why it works this way.

More information about the freebsd-net mailing list