Skip to content

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

Merged
merged 1 commit into from
Nov 21, 2019
Merged

Fix for sending IPv6 UDP packet over link local interface #11877

merged 1 commit into from
Nov 21, 2019

Conversation

cy-arsm
Copy link

@cy-arsm cy-arsm commented Nov 18, 2019

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)

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results (required)

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers (optional)


Release Notes (required for feature/major PRs)

Summary of changes
Impact of changes
Migration actions required

@sathishm6
Copy link

@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.

@ciarmcom ciarmcom requested review from a team November 18, 2019 06:00
@ciarmcom
Copy link
Member

@cy-arsm, thank you for your changes.
@ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

UDP packets when IPv4 and IPv6 dual mode stack is enabled and the IPv6
packet is sent over link-local inerface.
@cy-arsm
Copy link
Author

cy-arsm commented Nov 19, 2019

@AnttiKauppila can you also approve this pull request if you are ok with the modification.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 19, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Nov 19, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@sathishm6
Copy link

@0xc0170 - Hello Martin. Can this be merged and tagged for the coming release.

@sathishm6
Copy link

Hello Martin (@0xc0170) this PR needs your attention. Thanks

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 21, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Nov 21, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit 784b03b into ARMmbed:master Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants