Why can't I sendto() to 127.255.255.255
David S. Madole
david at madole.net
Mon Apr 30 10:32:31 UTC 2007
> From: Abraham K. Mathen on Monday, April 30, 2007 5:54 AM
>
> I wrote a short program (on FreeBSD 6.0), that attempts
> to call sendto() on a UDP socket, with 127.255.255.255 as
> the destination address. It failed - with errno 49 (EADDRNOTAVAIL).
> Setting SO_BROADCAST and IP_ONESBCAST did not help.
Perhaps because the matched route for that address points to lo0 on your system and lo0 is not a broadcast-capable interface?
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet 127.0.0.1 netmask 0xff000000
Note that there is no "BROADCAST" flag. Just a guess.
David
More information about the freebsd-hackers
mailing list