This is the mail archive of the
ecos-bugs@sourceware.org
mailing list for the eCos project.
[Bug 1001508] New: Add freebsd CDL option to allow broadcast packetsto be sent to 255.255.255.255
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: unassigned at bugs dot ecos dot sourceware dot org
- Date: Fri, 2 Mar 2012 21:23:17 +0000
- Subject: [Bug 1001508] New: Add freebsd CDL option to allow broadcast packetsto be sent to 255.255.255.255
- Auto-submitted: auto-generated
Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001508
Summary: Add freebsd CDL option to allow broadcast packets to
be sent to 255.255.255.255
Product: eCos
Version: CVS
Platform: All
OS/Version: Other
Status: NEW
Severity: enhancement
Priority: low
Component: TCP/IP
AssignedTo: unassigned@bugs.ecos.sourceware.org
ReportedBy: grant.b.edwards@gmail.com
CC: ecos-bugs@ecos.sourceware.org
Class: Advice Request
For reasons I've never understood, the BSD network stack has
historically coerced broadcast packets sent to 255.255.255.255 so that
they go out the door destined for the interface's local network
broadcast address instead of the specified global broadcast address.
IOW, if your network interface is configured as 192.168.100.33/24 and
you send a UDP broadcast packet to 255.255.255.255, it will actually be
sent with a destination IP of 192.168.100.255.
People in the BSD world have been complaining about (and working
around) this for ages.
The Linux network stack takes the simpler and more useful approach of
sending the packet to the destination as specified -- if you send
broadcast packet to 255.255.255.255, it goes out to 255.255.255.255,
and if you want to send a broadcast packet to 192.100.100.255, then
you send it to 192.168.100.255.
Several of our eCos based products must implement application protocols
that require UDP packets be sent to 255.255.255.255. To accomplish
this, I've been using a locally-modified bsd_tcpip stack with a CDL
option that allows you to choose either the (IMO broken) BSD behavior
or the Linux behavior. It defaults to the BSD behavior for the sake
of backwards-compatible brokenness.
Anyhow, here's a patch that adds the CDL option
CYGOPT_NET_FREEBSD_FORCE_DIRECTED_BROADCAST
It defaults to 1 which results in the traditional BSD behavior.
Setting it to 0 allows you to send packets to 255.255.255.255 by
specifying a destination address of 255.255.255.255.
--
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.