Skip to content

Move get_ip_address_if() to NetworkStack and include it in multihoming test #12063

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 3 commits into from
Dec 24, 2019

Conversation

michalpasztamobica
Copy link
Contributor

Summary of changes

When working on multihoming feature, get_ip_address_if() was wrongly put into OnboardNetworkStack::Interface. This is incorrect, because every of those interfaces only knows its own address, so it could only return and empty address in case the name doesn't match its name or it actual address if it does. Further more, the OnboardNetworkStack::Interface::get_ip_address_if() was not internally connected to any public API.

Instead get_ip_address_if() should only be an API of NetworkStack and implemented in LWIP class. This way we can make best use of the feature: the stack holding multiple interfaces will find the one with a matching name and return its address.

We haven't noticed this, because, the function was never called in our greentea tests. I don't think it deserves its own dedicated test, but at least I added checks confirming that the API returns the same addresses that the eth/wifi interfaces do, based on their string name identifiers.

Impact of changes

No real impact - the NetworkStack::get_ip_address_if() function will become usable.

Migration actions required

None.

Documentation

Already in place


Pull request type

[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

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

Reviewers

@kjbracey-arm
@AnttiKauppila
@tymoteuszblochmobica


@ciarmcom
Copy link
Member

@michalpasztamobica, thank you for your changes.
@AnttiKauppila @tymoteuszblochmobica @kjbracey-arm @ARMmbed/mbed-os-test @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@kjbracey kjbracey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only question is whether reworking a broken API is a breaking change.

@0xc0170 0xc0170 added the release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 label Dec 10, 2019
@bulislaw
Copy link
Member

Hey some of the deprecated methods seem to be silently dropped, also is this a breaking change from the user's point of view?

@kjbracey
Copy link
Contributor

kjbracey commented Dec 11, 2019

OnboardNetworkStack::Interface is not visible to application-type code - it's visible to drivers like UbloxWifiInterface or whatever that have registered themselves with the OnboardNetworkStack. They would use those methods to implement their application-facing NetworkInterface methods.

The particular method being removed has no obvious use though - it is not needed to implement any NetworkInterface calls. It seems it was put into OnboardNetworkStack::Interface without any thought about what the layers were doing, and then LWIP implemented that instead of the NetworkStack::get_ip_address_if it should have implemented.

@michalpasztamobica
Copy link
Contributor Author

@bulislaw , that is true - I did not move the string-based methods as they are on their way for removal anyway in another PR. Should I add them back?

@kjbracey-arm , just addressed the other question. Thanks, Kevin!

@bulislaw
Copy link
Member

@bulislaw , that is true - I did not move the string-based methods as they are on their way for removal anyway in another PR. Should I add them back?

Nah, but can you explicitly remove them with a separate commit so it's accounted for?

get_ip_address_if was wrongly added to OnboardNetworkStack::Interface, while it should in fact be placed directly in OnboardNetworkStack.
@michalpasztamobica
Copy link
Contributor Author

@bulislaw , I rearranged the commits, according to your suggestion. I hope I got it right?

@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 23, 2019

Test run: SUCCESS

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

@adbridge adbridge merged commit 5bef46b into ARMmbed:master Dec 24, 2019
@michalpasztamobica michalpasztamobica deleted the get_ip_address_if_fixed branch January 7, 2020 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants