buglwIP - A Lightweight TCP/IP stack - Bugs: bug #38061, wrong multicast routing in IPv4

 
 

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

bug #38061: wrong multicast routing in IPv4

Submitted by:  Artem Pisarenko <jblackarty>
Submitted on:  Fri 11 Jan 2013 07:03:23 AM UTC  
 
Category:  IPv4 Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  Simon Goldschmidt <goldsimon>
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Wed 02 Dec 2015 08:45:34 AM UTC, comment #3: 

hi,
I have exactly the same question as Artem mentioned.
pcb->multicast_ip is set only in lwip_setsockopt() and it's value is always zero in my case.
I'm using the application code from the vendor and the application is using netconn APIs.
Is it possible to set pcb->multicast_ip via netconn interface?

Axel Lin <axellin>
Project Member
Thu 26 Feb 2015 02:35:41 AM UTC, comment #2: 

Glad to know it fixed. Not sure if it fixed properly, since you rejected most of my thoughs, but I don't remember details...

>> Secondly, pcb->multicast_ip is set only in lwip_setsockopt() and it's value is always zero in my case.
>Well, why not set it? There is now a proper function to set it >without manipulating udp pcb internals: >'udp_set_multicast_netif_addr()'.


Is it possible from netconn interface ?

Artem Pisarenko <jblackarty>
Wed 25 Feb 2015 08:01:53 PM UTC, comment #1: 

> Firstly, first comment is wrong about IPv4


Correct. Fixed by moving into the IPv6 case.

> Secondly, pcb->multicast_ip is set only in lwip_setsockopt() and it's value is always zero in my case.


Well, why not set it? There is now a proper function to set it without manipulating udp pcb internals: 'udp_set_multicast_netif_addr()'.

> Thirdly, even if pcb->multicast_ip was set to correct address, ip_route (IPv4) can't find correct netif based on multicast address only.


Yes it does. 'multicast_ip' is not a multicast IP address but the (local) address of a netif to use for sending multicasts. See 'IP_MULTICAST_IF' on google. I admit the name of that variable is a bit misleading. But the new function name better explains this.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 11 Jan 2013 07:03:23 AM UTC, original submission:  

Sending multicast datagrams doesn't work correct in system having multiple network interfaces:
1. when there are no default interface, then netconn_send() returns ERR_RTE
2. when default interface set to other interface than we want to send over, netconn_send() either returns ERR_VAL, or sends datagram via default interface (or maybe just via first interface in netif list) depending on netconn configuration.

lwip udp_sendto() function:

#if LWIP_IPV6 || LWIP_IGMP
  if (ipX_addr_ismulticast(PCB_ISIPV6(pcb), dst_ip_route)) {
    /* For multicast, find a netif based on source address. */
#if LWIP_IPV6
    if (PCB_ISIPV6(pcb)) {
      dst_ip_route = &pcb->local_ip;
    } else
#endif /* LWIP_IPV6 */
    {
#if LWIP_IGMP
      dst_ip_route = ip_2_ipX(&pcb->multicast_ip);
#endif /* LWIP_IGMP */
    }
  }
#endif /* LWIP_IPV6 || LWIP_IGMP */

  /* find the outgoing network interface for this packet */
  netif = ipX_route(PCB_ISIPV6(pcb), &pcb->local_ip, dst_ip_route);

Firstly, first comment is wrong about IPv4. Secondly, pcb->multicast_ip is set only in lwip_setsockopt() and it's value is always zero in my case. Thirdly, even if pcb->multicast_ip was set to correct address, ip_route (IPv4) can't find correct netif based on multicast address only.

Artem Pisarenko <jblackarty>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by axellin (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by jblackarty (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-25 goldsimon StatusNone => Fixed
        Assigned toNone => goldsimon
        Open/ClosedOpen => Closed

    Back to the top


    Powered by Savane 3.5