buglwIP - A Lightweight TCP/IP stack - Bugs: bug #45120, Broadcast & multiple...

 
 

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

bug #45120: Broadcast & multiple interfaces handling

Submitted by:  Jens Nielsen <deft>
Submitted on:  Sun 17 May 2015 08:06:02 PM UTC  
 
Category: IPv4Severity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

Wed 19 Aug 2015 06:56:01 PM UTC, comment #2:

Fixed, thanks for the patch.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 18 May 2015 07:56:16 PM UTC, comment #1:

Sorry, I just noticed I introduced a compiler warning and (I suppose) should use ip4_addr_copy instead of ip_addr_copy... New patch attached.

(file #34047)

Jens Nielsen <deft>
Sun 17 May 2015 08:06:02 PM UTC, original submission:

This is a follow up to the discussion on https://savannah.nongnu.org/bugs/?38803

Since I wasn't happy with my first patch (because it was wrong) and I also found some other issues with broadcast packets I tried to straighten out what I believe would be the correct implementation with regards to handling of broadcasts and ping when having multiple interfaces.

The attached patch covers:

  • ICMP echo reply should use specific-destination address from request as source address, as per RFC 1122 3.2.1.3 "the destination address in the IP header unless the header contains a broadcast or multicast address, in which case the specific-destination is an IP address assigned to the physical interface on which the datagram arrived". The current implementation is incorrect when unicast ping is received on one interface but matching another, as Valery commented on bug #38803.
  • In most cases ip_addr_isbroadcast() compares with the netif the datagram arrived on, not the netif it actually matched.

Also attached a wireshark trace as demonstration of various pings. 192.168.5.198 is my PC, .88 is the main netif of my target, and 192.168.6.211 is a dummy netif I added to be able to test this.

Jens Nielsen <deft>

 

Attached Files
file #34047:  broadcast2.patch added by deft (4KiB - application/octet-stream)
file #34035:  broadcast.patch added by deft (4KiB - application/octet-stream)
file #34036:  broadcast_ping.pcap added by deft (834B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Updated the item)
  • -unavailable- added by deft (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 19 Aug 2015 06:56:01 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Wed 19 Aug 2015 08:34:27 AM UTCgoldsimonPlanned Release=>1.5.0
    Mon 18 May 2015 07:56:16 PM UTCdeftAttached File-=>Added broadcast2.patch, #34047
    Sun 17 May 2015 08:06:02 PM UTCdeftAttached File-=>Added broadcast.patch, #34035
      Attached File-=>Added broadcast_ping.pcap, #34036

    Back to the top


    Powered by Savane 3.1-cleanup1