Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd API to get ipv6 link local address #11279
Conversation
This comment has been minimized.
This comment has been minimized.
@cy-jayasankar, thank you for your changes. |
"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
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
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 |
LGTM @AnttiKauppila @SeppoTakalo please review |
This comment has been minimized.
This comment has been minimized.
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 |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
By opposing string based API, I meant that we should use SocketAddress instead of For couple of reasons:
|
This comment has been minimized.
This comment has been minimized.
Removed 5.14 label, added |
This comment has been minimized.
This comment has been minimized.
sathishm6
commented
Aug 29, 2019
•
@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. |
This comment has been minimized.
This comment has been minimized.
ifyall
commented
Aug 29, 2019
@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 |
This comment has been minimized.
This comment has been minimized.
40Grit
commented
Aug 30, 2019
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
This comment has been minimized.
This comment has been minimized.
@SeppoTakalo @maclobdell - I have pushed code for API changes as per the review comments. Can you please review the new changes. |
This comment has been minimized.
This comment has been minimized.
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. |
@@ -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) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cy-jayasankar
Sep 27, 2019
Author
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) |
This comment has been minimized.
This comment has been minimized.
SeppoTakalo
Sep 25, 2019
Contributor
Why this is here, instead of LWIPStack.cpp
where rest of the LWIP class members are.
This comment has been minimized.
This comment has been minimized.
cy-jayasankar
Sep 27, 2019
Author
get_ipv6_link_local_addr is a private function of the class. Public API's name is get_ipv6_link_local_address
nsapi_error_t EMACInterface::get_ipv6_link_local_address(SocketAddress *address) | ||
{ | ||
if (_interface && _interface->get_ipv6_link_local_address(address)) { | ||
return NSAPI_ERROR_PARAMETER; |
This comment has been minimized.
This comment has been minimized.
SeppoTakalo
Sep 25, 2019
Contributor
You are translating all possible errors to NSAPI_ERROR_PARAMETER
This comment has been minimized.
This comment has been minimized.
cy-jayasankar
Sep 27, 2019
Author
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; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 |
fe8cd5d
to
d20f623
This comment has been minimized.
This comment has been minimized.
@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. |
This comment has been minimized.
This comment has been minimized.
CI restarted |
This comment has been minimized.
This comment has been minimized.
mbed-ci
commented
Oct 30, 2019
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
This comment has been minimized.
This comment has been minimized.
@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
|
This comment has been minimized.
This comment has been minimized.
The linker errors are relevant. This PR changes the |
This comment has been minimized.
This comment has been minimized.
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
This comment has been minimized.
This comment has been minimized.
@michalpasztamobica thanks for sharing the new binaries. I have pushed these binaries to the PR. @0xc0170 Can you please trigger the CI. |
This comment has been minimized.
This comment has been minimized.
sathishm6
commented
Nov 4, 2019
@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. |
This comment has been minimized.
This comment has been minimized.
We will sort out this label later today. |
This comment has been minimized.
This comment has been minimized.
Ci started |
This comment has been minimized.
This comment has been minimized.
sathishm6
commented
Nov 4, 2019
Thanks @0xc0170 . Really appreciate your help. |
This comment has been minimized.
This comment has been minimized.
mbed-ci
commented
Nov 4, 2019
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
This comment has been minimized.
This comment has been minimized.
Release version updated to 5.15 |
This comment has been minimized.
This comment has been minimized.
sathishm6
commented
Nov 4, 2019
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. |
This comment has been minimized.
This comment has been minimized.
@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. |
This comment has been minimized.
This comment has been minimized.
sathishm6
commented
Nov 5, 2019
•
@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. |
This comment has been minimized.
This comment has been minimized.
As agreed, we are moving this to 5.14.2 |
This comment has been minimized.
This comment has been minimized.
sathishm6
commented
Nov 7, 2019
Thanks @0xc0170 Martin ! |
cy-jayasankar commentedAug 21, 2019
•
edited by adbridge
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.