-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix for IPv6 Dual Stack support #12791
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 IPv6 Dual Stack support #12791
Conversation
@morser499 can you review this changes. |
@cy-arsm, thank you for your changes. |
Issue: The problem is that there is a race condition introduced in that the LWIP thread is relying on the interface as it is taken down by a application thread while calling disconnect. In disconnect api called from application context, whd_emac_wifi_link_state_changed() will refer to netif interface structure in its callback api netif_link_irq(netif). This netif will be cleared by remove_etherent_interface(). whd_emac_wifi_link_state_changed will post message to tcpip_thread. tcpip_thread will process the message and call the callback api netif_link_irq(netif) Calling sequence is whd_emac_wifi_link_state_changed -> remove_etherent_interface(). Hence there is a timing issue that netif might be cleared first before tcpip thread process the message netif_link_irq(netif) Fix: remove_etherent_interface() will post message to tcpip thread and tcpip thread process the message delete_interface() which will actually remove the inferface from the netif_list. Calling sequence is whd_emac_wifi_link_state_changed() message post -> remove_etherent_interface() message post. message processing order netif_link_irq(netif) -> delete_interface(). Since both the processing is handled in single thread, processing of message is handled sequentially.
Changes seem reasonable. Is there a GreenTea test report for the Cypress boards? I want to confirm that there are no issues in the various network related tests (tests-netsocket-,tests-network-,tests-integration-*). |
@morser499 , Yes Greentea test's for cypress boards are available and i ran GT locally for CY8CPROTO_062_4343W. |
@AnttiKauppila @0xc0170 - Can this be merged for 5.15.2 release. We need this fix for our upcoming software release. |
This test report does not seem to include networking tests that would be impacted by this change. Do you have reports for the following suites? |
CI started |
@cy-arsm @sathishm6 @AnttiKauppila for this to even be considered for a release off 5.15 there needs to be a corresponding PR directly against that branch.....It is way past the code freeze for 5.15.2 which is literally about to be made. Checking with @andypowers and @bulislaw . |
@cy-arsm @sathishm6 Having spoken to @andypowers I'm afraid this has missed 5.15.2. If you would like this considered for a future release from 5.15 please raise the PR as mentioned above. |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
Modified LwIP mbed-os wrapper LWIPInterface.cpp to add an api remove interface which will be called as part of WhdSoftAPInterface::stop() to support sending UDP IPv6 packet is sent over link-local interface
Issue: udp_sendto() Fails for multicast IPV6 packet when interface is switched from SoftAP to STA mode.
When SoftAP start is called, add_ethernet_interface() will be called internally to add interface details into netif_list.
When switching from SoftAP to STA mode, add_ethernet_interface() will be called again to append the interace details into netif_list.
When udp_sendto() is called, ip6_route() will return interface as NULL since it consider device as single interface.
Summary of changes
LWIPInterface.cpp
LWIP::remove_ethernet_interface() api is added to remove the interface from the netif_list.
WhdSoftAPInterface.cpp
WhdSoftAPInterface::stop(), calling remove_ethernet_interface() from the network list which was added as part of WhdSoftAPInterface::start()
WhdSTAInterface.cpp
WhdSTAInterface::stop(), calling remove_ethernet_interface() from the network list which was added as part of WhdSTAInterface::start()
Impact of changes
Migration actions required
Documentation
--------------------------------------------------------------------------------------------------------------### Pull request type
Test results
Reviewers