buglwIP - A Lightweight TCP/IP stack - Bugs: bug #55972, The Neighbour Solicitation used to...

 
 

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

bug #55972: The Neighbour Solicitation used to do IPv6 address resolution was wrong

Submitter:  Gao Qingshui <kevingao>
Submitted:  Thu 21 Mar 2019 01:16:36 PM UTC
   
 
Category:  IPv6 Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Wed 17 Jul 2019 07:32:15 PM UTC, comment #4: 

Gao, this bug is closed. If comment #2 or #3 contain things to be addressed, please speak up!

Simon Goldschmidt <goldsimon>
Group administrator
Sun 14 Apr 2019 01:05:55 PM UTC, comment #3: 

for the ping failed issue I reported, the best fix method is to update the peer side's neighbour cache by sending one Neighbour Advertisement actively, with override flag. There was two way to do this, 1) make nd6_send_na not one static function and call it after L2 address changed; 2) call nd6_send_na at the last of netif_issue_reports, this modification is take IPv4 gratituous ARP as reference because GARP is sent out after L2 address changed, but I suggest to add the 3rd input argument for netif_issue_reports to make the caller decide which address used to send NA. the second way I prefer.

Gao Qingshui <kevingao>
Sun 14 Apr 2019 12:48:25 PM UTC, comment #2: 

Hi, I am sorry for the previous patch as it was bad. In IPv6, the way to judge whether one host was neighbour is very different from IPv4. pls refer the blog on "https://blog.ipspace.net/2012/11/ipv6-on-link-determination-what-is-it.html" for more info, you can also refer RFC4861 and RFC5942 for more official statements about IPv6 On-Link determination.
As a conclusion, In IPv6, it is possible that the neighbour is in one different subnet with the Neighbour Solicitation Sender. so lwip should NOT try to choose the source address based on the target address because it is likely that there was no such one address. The correct way is to try to use any valid address as the source of NS msg. pls review the attached patch again.

(file #46768)

Gao Qingshui <kevingao>
Sun 24 Mar 2019 08:35:07 PM UTC, comment #1: 

Applied, thanks for the patch!

Dirk Ziegelmeier <dziegel>
Group administrator
Thu 21 Mar 2019 01:16:36 PM UTC, original submission:  

The Neighbour Solicitation was used to do IPv6 address resolution or Duplicate Address Detection. For IPv6 address resolution, lwip always use the link local address as the source address, this could cause network unreachable in below scenario.
1,configure one global IPv6 address on one netif, such as 2001::2 on eth0 whos MAC address was 00:00:00:00:00:22;
2,ping the peer side which was Linux, ping succeed and on Linux one new neighbour cahe was created, 2001::2 + 00:00:00:00:00:22,
3,change the MAC address of netif eth0 from 00:00:00:00:00:22 to 00:00:00:00:00:33;
4,Ping the peer side again, ping failed and last about 10s, after then, ping succeed;
5,the reason of ping failed was that Linux still using the old neighbour cache (2001::2 + 00:00:00:00:00:22), after 10s, Linux get the new MAC address by multicast Neighbour Solicitation (2001::2 +  00:00:00:00:00:33), then ping succeed.
6, why the ping failure last 10s, it was the sum of 5s(Neighbour cache changed from STALE to Delay, and then from Delay to Probe)+ 3s (Linux send 3 unicast NS, and each one was 1s) + 2s(Ping interval).

The attached file was one real example, pls check. The other attach file was my modification, pls review.

Gao Qingshui <kevingao>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #46601:  11.pcap added by kevingao (5KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-14 kevingao Attached File- Added try-to-use-any-valid-address-as-source-of-NS.patch, #46768
    2019-03-24 dziegel StatusNone Fixed
        Open/ClosedOpen Closed
    2019-03-21 kevingao Attached File- Added 11.pcap, #46601
        Attached File- Added choose-source-address-based-on-target-address.patch, #46602

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code