lwIP - A Lightweight TCP/IP stack - Bugs: bug #49078, lwip cannot establish ipv6...
You are not allowed to post comments on this tracker with your current authentication level.
bug #49078: lwip cannot establish ipv6 connection, because of failed to fill ipv6 source address in Neighbor Solicitation Message
Submitter: | lishen <lishen5> | ||
Submitted: | Tue 13 Sep 2016 03:47:45 AM UTC | ||
Category: | IPv6 | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Invalid |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | git head |
Tue 20 Sep 2016 07:58:15 AM UTC, comment #4: |
lishen <lishen5> |
Mon 19 Sep 2016 03:45:30 PM UTC, comment #3: When I coded this I remember it was required to set up the LL address at index 0. It was a requirement and documented (somewhere... I think the Wikia page...).
|
Ivan Delamer <idelamer> |
Mon 19 Sep 2016 10:43:56 AM UTC, comment #2: RFC 4291, 2.1: "All interfaces are required to have at least one Link-Local unicast address"
|
Dirk Ziegelmeier <dziegel> |
Mon 19 Sep 2016 02:05:57 AM UTC, comment #1: I find that add a local-link address to the interface will solve this problem. However, with further reading the RFC (RFC4861 7.2.2), I find that RFC recommended to set Neighbor Solicitation Message's source address to the messages that triggers the NS message. I also read lwip's code (function 'nd6_send_ns'), it set the NS message's source address to an empty address if local-link address is not valid at slot 0. I think lwip should at least select a valid address when local-link address dose not exist, instead of using empty address.
|
lishen <lishen5> |
Tue 13 Sep 2016 03:47:45 AM UTC, original submission:
I test lwip on stm32f207 chip, when act as tcp server, it worked well. But I cannot establish tcp connection when lwip act as tcp client. Through wireshark, I found that lwip failed to fill source address in Neighbor Solicitation Message, this cause server to responsed an Unsolicited Neighbor Advertisement Message. Debug messages and screenshots are as fellow.
|
lishen <lishen5> |
Depends on the following items: None found
Items that depend on this one: None found
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 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2016-09-29 | goldsimon | Status | Fixed | Invalid | |
2016-09-29 | dziegel | Status | None | Fixed | |
Open/Closed | Open | Closed | |||
2016-09-13 | lishen5 | Attached File | - | Added debug_message.txt, #38492 | |
Attached File | - | Added lwip2linux.png, #38493 | |||
Attached File | - | Added win72linux.png, #38494 |
Powered by Savane 3.13-aa77.
Corresponding source code
Current behavior is acceptable, it was my mistake that not set a LL address. But add these lines to use any address available is not very complex, and not violate RFC, and make the code a little bit more robust. ^_^
880a881
882,890c883,898
< if (ip6_addr_isvalid(netif_ip6_addr_state(netif,0))) {
< /* Use link-local address as source address. */
< src_addr = netif_ip6_addr(netif, 0);
< /* calculate option length (in 8-byte-blocks) */
< lladdr_opt_len = ((netif->hwaddr_len + 2) + 7) >> 3;
< } else {
< src_addr = IP6_ADDR_ANY6;
< /* Option "MUST NOT be included when the source IP address is the unspecified address." */
< lladdr_opt_len = 0;
---