"message too long" when sending broadcasts
dwhite at gumbysoft.com
Sat Nov 19 16:55:10 PST 2005
On Wed, 16 Nov 2005, Michael Voucko wrote:
> I'm trying to install the latest version of heartbeat (linux-ha), which
> unfortunately is not available from the ports tree yet.
> Setup is two boxes running (5.4-STABLE FreeBSD from Oct 17 2005) both connected
> to a hub with lnc NICs on a private 10.0.0.0/24 subnet (actually its only a
> 'simulated hub' provided by VMWare if this matters).
> After some initial struggles configuration, build and installations works as
> expected - but now the most basic parts of this application won't work anymore.
> When trying to use UDP broadcast messages for the heartbeat it would error out
> with "Message too long" for packets larger than 1472 bytes, in other words as
> soon as fragmentation of the package would be necessary (MTU is 1500).
> I received a code snippet from the heartbeat developers to isolate the problem
> (create sender and receiver socket, send broadcast packets of a certain size).
> To rule out VMware as the basic problem I tried real boxes but the problem
> Is there any size restriction for UDP broadcast messages?
> Is there anything which prevents UDP broadcast from being fragmented?
> I searched RFCs, man pages for socket, setsockopt, ioctl, sendto and other
> places but did not find anything that could explain the behaviour (which seems
> to be no problem on other OS).
> Any pointers, comments?
The address of the target is given by to with tolen specifying its size.
The length of the message is given by len. If the message is too long to
pass atomically through the underlying protocol, the error EMSGSIZE is
returned, and the message is not transmitted.
I remember debugging some funky behavior regarding fragmenting packets and
UDPv6 some time ago. I don't remember if a fix was committed or not.
Doug White | FreeBSD: The Power to Serve
dwhite at gumbysoft.com | www.FreeBSD.org
More information about the freebsd-stable