-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix for sending IPv6 UDP packet over link local interface #11877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for sending IPv6 UDP packet over link local interface #11877
Conversation
@AnttiKauppila and @0xc0170 - For review. This fix is required to support mDNS protocol in next mbed-os release (aka 5.15) with IPv4 and IPv6 dual stack configuration. Kindly review. Thanks. |
@cy-arsm, thank you for your changes. |
UDP packets when IPv4 and IPv6 dual mode stack is enabled and the IPv6 packet is sent over link-local inerface.
@AnttiKauppila can you also approve this pull request if you are ok with the modification. |
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
@0xc0170 - Hello Martin. Can this be merged and tagged for the coming release. |
Hello Martin (@0xc0170) this PR needs your attention. Thanks |
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description (required)
Modified LwIP stack and LwIP mbed-os wrapper to support sending IPv6 UDP packets when IPv4 and IPv6 dual mode stack is enabled and the IPv6 packet is sent over link-local interface
Summary of change (What the change is for and why)
LWIPStack.cpp:
LWIP::socket_sendto( )API checks for valid IPv6 interface before sending the packet using netconn API. This condition check would return NSAPI_ERROR_PARAMETER error, when the UDP packet is sent on IPv6 link local interface. Hence modified the condition check to take address this use case.
lwip_tools.cpp:
convert_mbed_addr_to_lwip() API reset the ip_addr_t address to IPv4 when IP version is NSAPI_UNSPEC. Hence when dual IPv4 and IPv6 stack is enabled, local_ip is set to IPADDR_TYPE_V4.
During UDP packet send the type will be checked for IPADDR_TYPE_ANY since dual stack is enabled.
Hence setting the type to IPADDR_TYPE_ANY is done as part of convert_mbed_addr_to_lwip() when dual stack is enabled.
Pull request type (required)
Test results (required)
Reviewers (optional)
Release Notes (required for feature/major PRs)
Summary of changes
Impact of changes
Migration actions required