buglwIP - A Lightweight TCP/IP stack - Bugs: bug #43028, IP_MULTICAST_TTL affects unicast...

 
 

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

bug #43028: IP_MULTICAST_TTL affects unicast datagrams

Submitted by:  Joel Cunningham <jcunningham>
Submitted on:  Tue 19 Aug 2014 07:59:55 PM UTC  
 
Category: UDPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: 1.4.1

Wed 25 Feb 2015 08:59:41 PM UTC, comment #4:

Fixed, thanks for the patch.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 05 Dec 2014 03:00:22 PM UTC, comment #3:

In attached patch, I have added a multicast TTL field to the UDP PCB. I chose this because it follows the same path of implementation as IP_MULTICAST_IF and can be conditionally compiled.

I thought of putting the multicast TTL in the IP PCB because TTL and multicast are an IP layer concepts but ran into the complication where #if LWIP_IGMP can't be used inside of the #define that declares the IP_PCB

Joel Cunningham <jcunningham>
Project Member
Tue 26 Aug 2014 06:50:49 PM UTC, comment #2:

I'm not all that familiar with how often new members get added to the pcb, but is it out of the question to add another u8_t for mcast_ttl guarded by #if LWIP_IGMP. Then when sending datagrams, use the appropriate TTL depending on unicast or multicast destination address

If the bug isn't addressed, then applications are just going to end up having to create a second socket, possibly with SO_REUSEADDR (_PORT) depending on use case, to have unicast and multicast senders with different TTLs. This seems like it will consume more resources for that use case than u8_t

Joel Cunningham <jcunningham>
Project Member
Wed 20 Aug 2014 07:49:55 PM UTC, comment #1:

The report seems correct, but do you have an idea of how to fix? We don't have more than one place to store TTL, so this is a bug I'm tempted to accept for staying lightweight...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 19 Aug 2014 07:59:55 PM UTC, original submission:

When setting the IP_MULTICAST_TTL socket option via setsockopt(), all transmitted datagrams from that socket now use the TTL value specified in the setsockopt() call regardless of whether the destination of the datagram is unicast or multicast. My understanding of the socket option is that it should only affect datagrams sent (on that socket) to a multicast group.

Taking a look at the implementation, IP_MULTICAST_TTL sets the sock->conn->pcb.udp->ttl which is used for every call to ip_output_if from udp.c

Further, the getsockopt() returns sock->conn->pcb.ip->ttl (as opposed to pcb.udp->ttl for the setter)

Joel Cunningham <jcunningham>
Project Member

 

Attached Files
file #32602:  CORRECT-Fix-IP_MULTICAST_TTL-socket-option.patch added by jcunningham (3KiB - application/octet-stream - Use this patch, other one was diffed in wrong direction)
file #32601:  mcast-ip-ttl.patch added by jcunningham (3KiB - application/octet-stream - Here is the patch that my project is using to fix the multicast TTL issue)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by jcunningham (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 the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 25 Feb 2015 08:59:41 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Fri 05 Dec 2014 03:04:40 PM UTCjcunninghamAttached File-=>Added CORRECT-Fix-IP_MULTICAST_TTL-socket-option.patch, #32602
    Fri 05 Dec 2014 02:57:42 PM UTCjcunninghamAttached File-=>Added mcast-ip-ttl.patch, #32601

    Back to the top


    Powered by Savane 3.1-cleanup1