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

gnrc_sixlowpan: Preserve order when replacing 6lowpan header by decoded IPv6 header #5029

Merged
merged 1 commit into from
Mar 16, 2016

Conversation

jnohlgard
Copy link
Member

This fixes a very difficult to trace hard fault on a 6lbr when forwarding a reassembled fragmented UDP packet from 6lowpan to ethos (or another larger MTU device).
Without this change, the packet snips were arranged in the following order:
netiif->udp->ipv6
After this change the snips are:
udp->ipv6->netif

This caused a hard fault at gnrc_ipv6.c:826 trying to pktbuf release a NULL pointer.

The cause of the issue was that the 6lo header was the old head of the snip list:
6lo->netif
and in the old code, removing the 6lo header made netif the new head, and the decoded header was appended to the netif snip.

I tested this with #4544 and #4935 applied and IPHC UDP NHC reenabled.

The hard fault is gone but now the UDP checksum on the packet coming out on the ethos pipe is wrong, according to Wireshark.

@jnohlgard jnohlgard added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking GNRC labels Mar 10, 2016
@jnohlgard jnohlgard added this to the Release 2016.04 milestone Mar 10, 2016
@miri64
Copy link
Member

miri64 commented Mar 10, 2016

Did you find out why the UDP checksum is wrong? Wrong decompression or wrong reassembly might be the cause. I would like to have this fixed beforehand.

@jnohlgard
Copy link
Member Author

I'm guessing reassembly. I noticed that the packet is too small as well...

@miri64
Copy link
Member

miri64 commented Mar 10, 2016

Is this with #4935 or without?

@jnohlgard
Copy link
Member Author

both #4935 and #4544 applied

@miri64
Copy link
Member

miri64 commented Mar 10, 2016

(#4935 does not reassemble the packet in an payload->udp->ipv6->netif manner because it was way easier to just reassemble the IPv6 datagram in one snip and let IPv6 do the disentangling as it does for Ethernet)

@miri64
Copy link
Member

miri64 commented Mar 10, 2016

(so the result with #4935 after reassembly should be a packet payload->netif)

@jnohlgard
Copy link
Member Author

Okay, then I believe the actual cause is not corrected, but this PR solves a crash

@jnohlgard jnohlgard force-pushed the pr/6lo-decoded-hdr-snip-ordering branch from c34a557 to d770d6a Compare March 12, 2016 10:36
@jnohlgard
Copy link
Member Author

rebased.

@jnohlgard jnohlgard added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 12, 2016
@jnohlgard
Copy link
Member Author

@authmillenon ping

@miri64
Copy link
Member

miri64 commented Mar 16, 2016

Just am looking into it… but I'm still trying to find a test scenario for this :/

@miri64
Copy link
Member

miri64 commented Mar 16, 2016

Thought for some reason that this involved forwarding... Tested with a simple UDP example and it worked.

ACK and go.

miri64 added a commit that referenced this pull request Mar 16, 2016
gnrc_sixlowpan: Preserve order when replacing 6lowpan header by decoded IPv6 header
@miri64 miri64 merged commit 312047f into RIOT-OS:master Mar 16, 2016
@jnohlgard jnohlgard deleted the pr/6lo-decoded-hdr-snip-ordering branch March 17, 2016 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants