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

IPv6 Link Local address handling #313

Open
mkowalczyk88 opened this issue Dec 19, 2016 · 1 comment
Open

IPv6 Link Local address handling #313

mkowalczyk88 opened this issue Dec 19, 2016 · 1 comment
Labels

Comments

@mkowalczyk88
Copy link
Contributor

I was trying to use AwaLWM2M between Ci40 and 6lowpan clicker.
I saw following issues:

  1. Even if I explicitly set local ip address on a command line argument of awa_serverd (example: awa_serverd --interface lowpan0 --addressFamily 6 --port 5683 --ip=fe80::c892:fd83:e6b7:c392 -v -o temp_object.xml) it still wants to bind to the Global Scope address (for example to 2001:1418:100::1/48). It should bind to the address I passed as an argument. See "Lwm2mCore_GetIPAddressFromInterface": there is the if-else statement checking firstly "globalIpv6Address" and then does not care about link local at all.
  2. When I forced it to bind to the local link address (by hardcoding it in code) I encoutered new problems. The link local address is kept together with iface name "fe80::c892:fd83:e6b7:c392%lowpan0". Normally this is not a problem, but in function "NetworkAddress_FromIPAddress" there is a call to "inet_pton" which does NOT accept "%iface" format.
  3. When I forced inet_pton to succeed (by hardcoding address without "%iface" in code) it came out that call to "bind" in NetworkSocket_StartListening fails because of "invalid argument". This is because for link local IPv6 addresses, the "sin6_scope_id" should be set.
  4. When I forced sin6_scope_id to be set (by hardcoding result->Address.Sin6.sin6_scope_id = if_nametoindex("lowpan0") inside "NetworkAddress_FromIPAddress") I finally could see my AwaLWM2M client. The UDP packets were exchanged so I saw my client on a list (awa-server-list-clients). Unfortunetly, when I tried to read my resource I got segmentation fault on a server side. I didn't debug it further.
@datachi7d
Copy link
Collaborator

This appears to be a bug with our network abstraction layer. We need to investigate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants