-
Notifications
You must be signed in to change notification settings - Fork 3k
Add API to get ipv6 link local address #11279
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
Add API to get ipv6 link local address #11279
Conversation
@cy-jayasankar, thank you for your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Added API to get ipv6 link local address" - adding functionality should contain better changes description in the commit message.
My questions would be "why this is needed" and "how to be used" that could be answered in the commit message.
7f145b1
to
7d82eda
Compare
Once you update, please send an update here with the current status, helps to keep track and notify us about the changes here as well. |
Hi..I have updated the commit with following Protocols like mdns requires IPv6 link local address to be advertised in its This new API is required to deliver mDNS library support on mbed-os for Cypress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @AnttiKauppila @SeppoTakalo please review
Note, we are close to the 5.14 code freeze. This needs update asap to be in 5.14 otherwise will move to the next minor version |
I think this needs more thought. Having able to fetch link local addresses, or multicast addresses, would be useful thing. So I do see the point. I just don't like the way we are going with these string based APIs. I have been verbally against those, and proposed dropping all string based APIs in future. And I would also like to drop all Overall, I'm not in favour of this. It is a LwIP only, and it is a string based. Therefore I propose that we postpone it and rethink the API to be more general "give me list of all addresses" type that all other OS'es have. |
By opposing string based API, I meant that we should use SocketAddress instead of For couple of reasons:
|
Removed 5.14 label, added |
@SeppoTakalo - I do agree with your proposal, it makes a better API design and in the long run to have APIs like linux getifaddrs(). But I also have a slightly different approach to propose. Today there are many string based APIs exist in mbed-os (as you have listed it out). Hence having this API wouldn't be a harm, and it in-fact would help in unblocking certain development like mDNS protocol, IPv6 multicast usecases, etc. Once we have the cleaner API, we can depreciate this API along with all other existing string based APIs. Meanwhile everyone can use the API proposed in this PR to continue the development to make progress in bringing more protocols like mDNS to the mbed-os eco-system. This would make a win-win situation. Let me know your thoughts. Thanks. |
@SeppoTakalo and @maclobdell , I agree with @sathishm6 's analysis. If we want to clean up the Mbed API set to not have string-based APIs, we should do that. Adding this item now and then cleaning up Mbed APIs in general is a reasonable compromise between long term plans and short term feature enhancements of the platform. Thanks, Ian |
What effort is involved to provide an API that uses well defined types as described by @SeppoTakalo? Can this wait till 5.14.1? |
7d82eda
to
b728142
Compare
@SeppoTakalo @maclobdell - I have pushed code for API changes as per the review comments. Can you please review the new changes. |
This is now for @AnttiKauppila and @kjbracey-arm to review whether they are happy to support this new API on all other stacks than LwIP. |
features/lwipstack/LWIPInterface.cpp
Outdated
@@ -273,6 +273,52 @@ char *LWIP::Interface::get_interface_name(char *buf) | |||
return buf; | |||
} | |||
|
|||
static bool convert_lwip_addr_to_mbed(nsapi_addr_t *out, const ip_addr_t *in) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why these have been moved from lwip_tools.cpp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in older version of mbed-os this function was not available in lwit_tools.cpp. I have re-based the patch and removed this function from LWIPInterface.cpp file.
@@ -74,6 +74,23 @@ const ip_addr_t *LWIP::get_ipv4_addr(const struct netif *netif) | |||
return NULL; | |||
} | |||
|
|||
const ip_addr_t *LWIP::get_ipv6_link_local_addr(const struct netif *netif) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is here, instead of LWIPStack.cpp
where rest of the LWIP class members are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_ipv6_link_local_addr is a private function of the class. Public API's name is get_ipv6_link_local_address
features/netsocket/EMACInterface.cpp
Outdated
nsapi_error_t EMACInterface::get_ipv6_link_local_address(SocketAddress *address) | ||
{ | ||
if (_interface && _interface->get_ipv6_link_local_address(address)) { | ||
return NSAPI_ERROR_PARAMETER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are translating all possible errors to NSAPI_ERROR_PARAMETER
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed code to return the return value of _interface->get_ipv6_link_local_address
|
||
virtual nsapi_error_t get_ipv6_link_local_address(SocketAddress *address) | ||
{ | ||
return NSAPI_ERROR_OK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be NSAPI_ERROR_UNSUPPORTED
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed code with this change
One note:
Can we be more specific here ? Where we are adding this, how the API looks like ? This is in the release notes, it should be clear what is being added and what it does. can be one small paragraph describing this new API |
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
fe8cd5d
to
d20f623
Compare
@0xc0170 Nanostack class is deriving OnboardNetworkStack class and get_ipv6_link_local_address was defined as pure virtual function in OnboardNetworkStack class. To fix the CI failures related to nanostack, I have changed get_ipv6_link_local_address to virtual function with default implementation in OnboardNetworkStack.h file and pushed the changes. Please trigger Ci and also let me know if you have any comments with this code change. |
CI restarted |
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
@0xc0170 @michalpasztamobica from the failure log of the recent CI mbed-os-examples_MTB_ADV_WISE_1530_GCC_ARM.log looks like the errors are not related to this PR. Below are the errors copied from the log
|
The linker errors are relevant. This PR changes the |
The new binaries are available here. @cy-jayasankar , please, put them on your branch and ping Martin when ready for another CI run. I noticed that in February Seppo submitted more binaries, but those extra targets have been removed. I checked that new binaries contain the new |
Protocols like mdns requires IPv6 link local address to be advertised in its records (AAAA record). LWIP::Interface::bringup() API is creating IPv6 link local address;But as of now there is no API exposed by mbed-os to get the IPv6 link local address. This new API is required to deliver mDNS library support on mbed-os for Cypress platforms. Unit tested it by invoking get_ipv6_link_local_address with a simple application.
d20f623
to
cb51fa5
Compare
@michalpasztamobica thanks for sharing the new binaries. I have pushed these binaries to the PR. @0xc0170 Can you please trigger the CI. |
@0xc0170 - I notice this is labeled for 6.0 RC release. Whereas we have been working-on to get this fix into mbed-os from 5.14.1 release. This is just an addition to existing set of IPv6 APIs, and not a new feature. Hence I feel this fix should be merged to mbed-os asap. Also this PR is currently blocking some of the software features we offer on mbed-os with our platforms, hence we would need this fix in mbed-os 5.14.2 release. (attn: @ifyall) @AnttiKauppila - Thanks for reviewing this PR, I noticed you have also added a label 'needs: work'. Do you still see any rework pending on this PR? Let us know, so that we can address them before 5.14.2 code freeze date. Thanks. |
We will sort out this label later today. |
Ci started |
Thanks @0xc0170 . Really appreciate your help. |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Release version updated to 5.15 |
Hello Martin (@0xc0170), why this fix can't make it in mbed-os 5.14.2 release. Could you please share the reason. What is the ETA for 5.15 release? Thanks. |
@sathishm6 - changes to functionality, including extending APIs are intended for minor or major release versions. Patch releases are intended for bug fixes only. This is why this change is marked for 5.15, which is a minor release. In the future, the Mbed project plans to adopt a more flexible release schedule which will allow minor/major releases to happen more frequently if necessary. |
@maclobdell - Thanks for the details. What is the ETA for 5.15 availability. Is there a possibility to make the next release as 5.15 release instead of 5.14.2. Is that a option? I want to know your suggestion and thoughts on this, so that, we can do the best to unblock our release, which would help us offer more software features to our customers on mbed-os platform. Let me know your suggestion. Thanks. |
As agreed, we are moving this to 5.14.2 |
Thanks @0xc0170 Martin ! |
Description
This PR provides API for applications to get the IPv6 link local address.
Pull request type
Reviewers
Please suggest
Release Notes
Added a new API called get_ipv6_link_local_address in NetworkInterface class.
This API returns IPv6 link local address and below is the syntax of the API.