tasklwIP - A Lightweight TCP/IP stack - Tasks: task #6995, Implement SO_REUSEADDR

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

task #6995: Implement SO_REUSEADDR

Submitted by:  Frédéric Bernon <fbernon>
Submitted on:  Sat 09 Jun 2007 12:02:00 PM UTC  
 
Category: NoneShould Start On: Fri 08 Jun 2007 10:00:00 PM UTC
Should be Finished on: Fri 08 Jun 2007 10:00:00 PM UTCPriority: 1 - Later
Status: NonePrivacy: Public
Percent Complete: 0%Assigned to: None
Open/Closed: OpenPlanned Release: None
Effort: 0.00

(Jump to the original submission Jump to the original submission)

Thu 29 Nov 2007 01:44:41 AM UTC, comment #6:

You should be able to bind to 255.255.255.255 - it is meant to have the same meaning as INADDR_ANY. From the ip(7) manpage on linux:
-=-=-=-=-=-=-=-
There are several special addresses: INADDR_LOOPBACK (127.0.0.1) always refers to the local host via the
loopback device; INADDR_ANY (0.0.0.0) means any address for binding; INADDR_BROADCAST (255.255.255.255)
means any host and has the same effect on bind as INADDR_ANY for historical reasons.
-=-=-=-=-=-=-=-

In order to send/receive broadcast datagrams, instead in POSIX the SO_BROADCAST flag is used:
http://www.opengroup.org/pubs/online/7908799/xns/setsockopt.html

Although that link only says "transmission" and my Linux man page says: "When enabled, datagram sockets receive packets sent to a broadcast address and they are allowed to send packets to a broadcast address."

Jonathan Larmour <jifl>
Project Member
Wed 28 Nov 2007 07:16:48 PM UTC, comment #5:

one of the local ip addresses, or "any" (all interfaces).

That's why I asked in bug #21656 if there was any real reference to know what is a "standard" practice, and what is not.

Is it possible to bind to the broadcast address (255.255.255.255)? What is/should be the behavior?

Frédéric Bernon <fbernon>
Project Member
Wed 28 Nov 2007 07:11:42 PM UTC, comment #4:

> bind a local multicast address?


I thought that was how it's done... Never used multicast...

Which local address do you bind to when receiving UDP multicast?

Simon Goldschmidt <goldsimon>
Project Member
Wed 28 Nov 2007 01:16:59 PM UTC, comment #3:

>udp_bind does currently not check for multiple binding, which looks like a bug to me! This was disabled because it prevented binding multiple pcbs to a local multicast address. I think that should be changed.


bind a local multicast address? When you want to receive multicast, you just have to bind to a local/netif ip address (or "any"), and join the group. Same for broadcast. Or I don't understand your comment?

Frédéric Bernon <fbernon>
Project Member
Wed 28 Nov 2007 12:44:32 PM UTC, comment #2:

Some more notes:

- udp_bind does currently not check for multiple binding, which looks like a bug to me! This was disabled because it prevented binding multiple pcbs to a local multicast address. I think that should be changed.

- when incoming packets are for multicast, udp_input should call the recv function for all udp_pcbs listening to that port & address. Currently, only the first pcb in the list will receive the data...

Simon Goldschmidt <goldsimon>
Project Member
Tue 04 Sep 2007 09:03:35 AM UTC, comment #1:

Some notes:

in udp.c, we can found some code disabled by LWIP_UDP_TODO option, in udp_bind, and this comment:

"this code does not allow upper layer to share a UDP port for listening to broadcast or multicast traffic (See SO_REUSE_ADDR and SO_REUSE_PORT under *BSD). TODO: See where it fits instead, OR combine with implementation of UDP PCB flags. Leon Woestenberg."

Frédéric Bernon <fbernon>
Project Member
Sat 09 Jun 2007 12:02:00 PM UTC, original submission:

Replace http://savannah.nongnu.org/bugs/?2809:

"Implement REUSEADDR in udp.c (by expanding the udp_pcb data structure)."

Frédéric Bernon <fbernon>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jifl (Posted a comment)
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by fbernon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter 421 here (basic anti-spam test):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup