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 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 ciarmcom requested review from kjbracey-arm, michalpasztamobica, mikaleppanen, SeppoTakalo and ARMmbed/mbed-os-maintainers Oct 18, 2019
@ciarmcom

This comment has been minimized.

Copy link
Contributor

michalpasztamobica left a comment

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-arm

This comment has been minimized.

Copy link
Contributor

kjbracey-arm 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

This comment has been minimized.

Copy link
Contributor Author

tymoteuszblochmobica commented Nov 8, 2019

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

Copy link
Contributor

kjbracey-arm left a comment

Looks plausible to me.

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Nov 12, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Nov 12, 2019

CI started

@mbed-ci

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

0xc0170 commented Nov 13, 2019

CI restarted

@mbed-ci

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

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

@0xc0170 0xc0170 added needs: work and removed needs: CI labels Nov 13, 2019
@tymoteuszblochmobica tymoteuszblochmobica force-pushed the tymoteuszblochmobica:linklocal branch from 686ec73 to 6514433 Nov 14, 2019
@tymoteuszblochmobica

This comment has been minimized.

Copy link
Contributor Author

tymoteuszblochmobica commented Nov 14, 2019

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

@AnttiKauppila AnttiKauppila added needs: CI and removed needs: work labels Nov 15, 2019
@adbridge

This comment has been minimized.

Copy link
Contributor

adbridge commented Nov 15, 2019

CI started

@mbed-ci

This comment has been minimized.

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 added ready for merge and removed needs: CI labels Nov 15, 2019
@adbridge adbridge merged commit 7cfa6fa into ARMmbed:master Nov 15, 2019
26 checks passed
26 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(-688 bytes) RAM(-16 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8690 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8420B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.