public inbox for ecos-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug 1001508] New: Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255
@ 2012-03-02 21:23 bugzilla-daemon
  2012-03-02 21:26 ` [Bug 1001508] " bugzilla-daemon
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: bugzilla-daemon @ 2012-03-02 21:23 UTC (permalink / raw)
  To: unassigned

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 1001508] Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255
  2012-03-02 21:23 [Bug 1001508] New: Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255 bugzilla-daemon
@ 2012-03-02 21:26 ` bugzilla-daemon
  2012-03-02 21:29 ` bugzilla-daemon
  2012-03-03  4:12 ` bugzilla-daemon
  2 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2012-03-02 21:26 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001508

--- Comment #1 from Grant Edwards <grant.b.edwards@gmail.com> 2012-03-02 21:25:51 GMT ---
Created an attachment (id=1607)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1607)
Add CDL option to allow sending broadcast packets to 255.255.255.255

Not sure why attachment didn't work the first time...

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 1001508] Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255
  2012-03-02 21:23 [Bug 1001508] New: Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255 bugzilla-daemon
  2012-03-02 21:26 ` [Bug 1001508] " bugzilla-daemon
@ 2012-03-02 21:29 ` bugzilla-daemon
  2012-03-03  4:12 ` bugzilla-daemon
  2 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2012-03-02 21:29 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001508

Grant Edwards <grant.b.edwards@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1607|0                           |1
        is obsolete|                            |

--- Comment #2 from Grant Edwards <grant.b.edwards@gmail.com> 2012-03-02 21:29:25 GMT ---
Created an attachment (id=1608)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1608)
Add CDL option to allow sending broadcast packets to 255.255.255.255

Sorry -- first uploaded patch contained some unrelated changes it wasn't
supposed to.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 1001508] Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255
  2012-03-02 21:23 [Bug 1001508] New: Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255 bugzilla-daemon
  2012-03-02 21:26 ` [Bug 1001508] " bugzilla-daemon
  2012-03-02 21:29 ` bugzilla-daemon
@ 2012-03-03  4:12 ` bugzilla-daemon
  2 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2012-03-03  4:12 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001508

Jonathan Larmour <jifl@ecoscentric.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jifl@ecoscentric.com
         AssignedTo|unassigned@bugs.ecos.source |jifl@ecoscentric.com
                   |ware.org                    |

--- Comment #3 from Jonathan Larmour <jifl@ecoscentric.com> 2012-03-03 04:12:25 GMT ---
There's nothing wrong with the patch in principle, but the description of the
CDL option, while accurate, could be clarified. In fact what you wrote in the
first and last paragraphs of comment #0 is quite clear. So how about something
like:

            In line with other IP stack implementations, the BSD network stack
            has historically converted packets sent to the INADDR_BROADCAST
            destination addresses (255.255.255.255) into a more specific
            directed broadcast address according to the address configuration
of
            the primary network interface. For example 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 address of 192.168.100.255. Over time, this behavior
            has been criticized for various reasons.  The primary reason is
that
            it becomes impossible to send UDP packets to 255.255.255.255 once
the
            primary network (broadcast) interface is configured with address
            information. For this reason, it is possible to disable this
behavior
            with this option so that packets will be sent explicitly to
            INADDR_BROADCAST when that destination address is specified."

Something along those lines would be fine by me anyway. If you're happy with
that, then go ahead and check it in with that text.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 1001508] Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255
  2012-03-02 21:23 [Bug 1001508] New: " bugzilla-daemon
                   ` (2 preceding siblings ...)
  2012-03-03  4:12 ` bugzilla-daemon
@ 2012-03-06 19:15 ` bugzilla-daemon
  3 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2012-03-06 19:15 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001508

Grant Edwards <grant.b.edwards@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |NEXTRELEASE

--- Comment #4 from Grant Edwards <grant.b.edwards@gmail.com> 2012-03-06 19:14:44 GMT ---
Committed changes with CDL help text updated as per Comment 3:

/cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/ChangeLog,v  <--  ChangeLog
new revision: 1.76; previous revision: 1.75

/cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/cdl/freebsd_net.cdl,v  <-- 
freebsd_net.cdl
new revision: 1.16; previous revision: 1.15

/cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/src/sys/netinet/in_pcb.c,v  <-- 
in_pcb.c
new revision: 1.6; previous revision: 1.5

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 1001508] Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255
  2012-03-02 21:23 [Bug 1001508] New: " bugzilla-daemon
  2012-03-02 21:26 ` [Bug 1001508] " bugzilla-daemon
  2012-03-02 21:29 ` bugzilla-daemon
@ 2012-03-03  4:12 ` bugzilla-daemon
  2012-03-06 19:15 ` bugzilla-daemon
  3 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2012-03-03  4:12 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001508

Jonathan Larmour <jifl@ecoscentric.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jifl@ecoscentric.com
         AssignedTo|unassigned@bugs.ecos.source |jifl@ecoscentric.com
                   |ware.org                    |

--- Comment #3 from Jonathan Larmour <jifl@ecoscentric.com> 2012-03-03 04:12:25 GMT ---
There's nothing wrong with the patch in principle, but the description of the
CDL option, while accurate, could be clarified. In fact what you wrote in the
first and last paragraphs of comment #0 is quite clear. So how about something
like:

            In line with other IP stack implementations, the BSD network stack
            has historically converted packets sent to the INADDR_BROADCAST
            destination addresses (255.255.255.255) into a more specific
            directed broadcast address according to the address configuration
of
            the primary network interface. For example 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 address of 192.168.100.255. Over time, this behavior
            has been criticized for various reasons.  The primary reason is
that
            it becomes impossible to send UDP packets to 255.255.255.255 once
the
            primary network (broadcast) interface is configured with address
            information. For this reason, it is possible to disable this
behavior
            with this option so that packets will be sent explicitly to
            INADDR_BROADCAST when that destination address is specified."

Something along those lines would be fine by me anyway. If you're happy with
that, then go ahead and check it in with that text.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 1001508] Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255
  2012-03-02 21:23 [Bug 1001508] New: " bugzilla-daemon
  2012-03-02 21:26 ` [Bug 1001508] " bugzilla-daemon
@ 2012-03-02 21:29 ` bugzilla-daemon
  2012-03-03  4:12 ` bugzilla-daemon
  2012-03-06 19:15 ` bugzilla-daemon
  3 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2012-03-02 21:29 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001508

Grant Edwards <grant.b.edwards@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1607|0                           |1
        is obsolete|                            |

--- Comment #2 from Grant Edwards <grant.b.edwards@gmail.com> 2012-03-02 21:29:25 GMT ---
Created an attachment (id=1608)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1608)
Add CDL option to allow sending broadcast packets to 255.255.255.255

Sorry -- first uploaded patch contained some unrelated changes it wasn't
supposed to.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 1001508] Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255
  2012-03-02 21:23 [Bug 1001508] New: " bugzilla-daemon
@ 2012-03-02 21:26 ` bugzilla-daemon
  2012-03-02 21:29 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2012-03-02 21:26 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001508

--- Comment #1 from Grant Edwards <grant.b.edwards@gmail.com> 2012-03-02 21:25:51 GMT ---
Created an attachment (id=1607)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1607)
Add CDL option to allow sending broadcast packets to 255.255.255.255

Not sure why attachment didn't work the first time...

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-03-06 19:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-02 21:23 [Bug 1001508] New: Add freebsd CDL option to allow broadcast packets to be sent to 255.255.255.255 bugzilla-daemon
2012-03-02 21:26 ` [Bug 1001508] " bugzilla-daemon
2012-03-02 21:29 ` bugzilla-daemon
2012-03-03  4:12 ` bugzilla-daemon
2012-03-02 21:23 [Bug 1001508] New: " bugzilla-daemon
2012-03-02 21:26 ` [Bug 1001508] " bugzilla-daemon
2012-03-02 21:29 ` bugzilla-daemon
2012-03-03  4:12 ` bugzilla-daemon
2012-03-06 19:15 ` bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).