Skip to content
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

LWIP::get_ipv6_addr for link-local only #11714

Merged
merged 1 commit into from
Nov 15, 2019

Conversation

tymoteuszblochmobica
Copy link
Contributor

@tymoteuszblochmobica tymoteuszblochmobica commented Oct 18, 2019

LWIP::get_ipv6_addr is modified to avoid netif NULL return if only link-local adress
exists.
Second netifs loop iteration is added.
On original pass global IP is preffered if it fails also netifs for link-local are considered on second loop.
This can avoid to return NULL if local adress exists.

Initial IPV6 issue #11442

Description

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@SeppoTakalo
@mikaleppanen
@kjbracey-arm
@michalpasztamobica

Release Notes

@ciarmcom
Copy link
Member

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

Copy link
Contributor

@michalpasztamobica michalpasztamobica left a comment

Choose a reason for hiding this comment

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

Considering the fact that LWIP_IPV6_NUM_ADDRESSES is 3, I personally think this solution is acceptable.
Although it would be great to know what is the point of ignorig the linklocal addresses in the first place. @kjbracey-arm , do you know the reason behind this check:
!ip6_addr_islonklocal(netif_ip6_addr(netif, i)) in line 91 of lwip_tools.cpp?
Perhaps there is a good reason not to return it?

@kjbracey
Copy link
Contributor

kjbracey commented Oct 23, 2019

I think the desired behaviour is what you're doing here.

This call is used in the context "give me one address", and for that we want to give a global address if possible, hence the existing check, but it should fall back to link-local if that's all it's got.

I've cross-checked what Nanostack::get_ip_addr does, and it uses a Nanostack call that returns a single address, preferring addresses with wider scope, which achieves the same effect as this.

However, I think you need to check the event generation for NSAPI_STATUS_GLOBAL_UP. I think if you change this routine, it will trigger HAS_ANY_ADDR and hence that event prematurely.

If you compare with Nanostack, you'll see that it checks that the "get address" function hasn't returned the local address to distinguish LOCAL_UP and GLOBAL_UP.

LWIP currently isn't generating LOCAL_UP at all. I think that dates back to when it was IPv4 only, which doesn't really have the concept. (Unless we used autoip, which we don't).

@tymoteuszblochmobica
Copy link
Contributor Author

@kjbracey-arm I changed netif status generating.
Please check if this is what you suggested.

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.

Looks plausible to me.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 12, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Nov 12, 2019

Test run: FAILED

Summary: 3 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-IAR
  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 13, 2019

I don't understand how failures relate to this one , from one log : [Error] main.cpp@34,25: use of undeclared identifier 'MBED_CONF_APP_ECHO_SERVER_HOSTNAME' [Error] main.cpp@37,18: use of undeclared identifier 'MBED_CONF_APP_ECHO_SERVER_PORT'

Is this CI config mismatch? cc @VeliMattiLahtela

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 13, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Nov 13, 2019

Test run: FAILED

Summary: 3 of 4 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-IAR
  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 13, 2019

One failure in the logs : [Error] LWIPInterface.cpp@232,17: no member named 'addr' in 'ip_addr' . 2 targets fail across toolchains, please review

@tymoteuszblochmobica
Copy link
Contributor Author

[Error] LWIPInterface.cpp@232,17: no member named 'addr' in 'ip_addr' is fixed now

@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Nov 15, 2019

Test run: SUCCESS

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

@adbridge adbridge merged commit 7cfa6fa into ARMmbed:master Nov 15, 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.

8 participants