gnrc_sixlowpan_iphc: fix _compressible()#10950
Conversation
When either `gnrc_sixlowpan_iphc_nhc` or `gnrc_udp` is not compiled in `_compressible()` never returns `true`. This causes the `dispatch` snip in `gnrc_sixlowpan_iphc_send()` to be of length 0, meaning `dispatch->data` is `NULL`, causing possible crashes when trying to send IPv6 packets over 6LoWPAN without NHC or UDP.
| case GNRC_NETTYPE_IPV6: | ||
| #if defined(MODULE_GNRC_SIXLOWPAN_IPHC_NHC) && defined(MODULE_GNRC_UDP) | ||
| case GNRC_NETTYPE_UDP: | ||
| return true; |
There was a problem hiding this comment.
@cgundogan I remember some discussion about this line, I believe with you... however this exists since 0a9793c, so I'm not sure when and where this happened.
There was a problem hiding this comment.
hm, tbh I do not remember such a discussion, but the change is clearly an improvement ..
There was a problem hiding this comment.
Ok, then we agree, that this change fixes things :-)
|
Tested the following with this PR: native - native Wireshark dump looks ok (no 6Lo of course) samr21-xpro - samr21-xpro gnrc_tcp_* |
First of all, we need to make sure they ever worked on this board? If no, and they don't crash this is non-blocking as it has nothing to do with this PR (but might still have to do with #10947). |
|
Of course it doesn't work. The client tries to connect to |
|
@PeterKietzmann can you try with the |
|
Already tried that, without success. But I can't even get it to work on 2018.07 release branch. I agree that it's unrelated to this PR but it would've been great if it was clarified in here. |
|
(btw: yes packets are dropped in |
I developed and test gnrc_tcp mostly on the samr21-xpro. Both application worked. |
|
So I'm gonna open a separate issue. ACK for the fix in this PR |
|
I just tested the |
|
That's an other issue. Please read #10945 carefully. If you start the client shortly before the server, it should directly work. I'm gonna open a separate issue for the missing ND. |
The ND is not missing. The test is using it wrong. |
Didn't know about that issue yet ;-). |
Then how about you open a new issue? Because all I see is missing ND, an empty NIB and I don't really know how a correct usage would look like. |
How to use it right then? I mean the test are crappy currently but I want to keep them alive until I find the time to replace them. |
|
I don't know. I had to look into what's going on there exactly. However, since they are the only networking-related tests having problems ATM, my assessment is rather that something weird is happening there, than in the networking layer. |
|
Okay well then, the highest priority for the existing TCP test should be, cause as less problems as possible. Secondly, I am working more or less frequently on replacing the existing gnrc_tcp tests. |
|
Backport provided in #10954 |
Link-local addresses are fine. Everything else would require even more network bootstrapping (configuring routes etc). However, the suffix should be based on the link-local address for 6Lo-based networks (see RFC 6775 for why that is).
Will do when I find the time. |

Contribution description
When either
gnrc_sixlowpan_iphc_nhcorgnrc_udpis not compiled in_compressible()never returnstrue. This causes thedispatchsnip ingnrc_sixlowpan_iphc_send()to be of length 0, meaningdispatch->dataisNULL, causing possible crashes when trying to send IPv6 packets over 6LoWPAN without NHC or UDP.Testing procedure
tests/gnrc_tcp_serverandtests/gnrc_tcp_clientshould work on a 6Lo-based board.examples/gnrc_networkingshould still be able to exchange UDP packets. Those packets should be compressed with NHC (check with sniffer).Issues/PRs references
Fixes #10947