-
Notifications
You must be signed in to change notification settings - Fork 2k
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_iphc.c: handle forwarded GNRC_NETTYPE_IPV6 packet #5232
Conversation
This is ugly, but it fixes the symptom (forwarded packets have 0 length payload). The proper fix would probably be to mark the UDP header in the correct location and mark the remaining payload snip as NETTYPE_UNDEF or something. |
@ReneHerthel maybe this is of interest for you |
Tested it rebased to master with an ethos border router (sending UDP packets to and from the host system using netcat) and it worked. ACK and go when |
Let go of Travis (:
|
(already corrected it ;-P) |
if (udp->type == GNRC_NETTYPE_IPV6) { | ||
/* forwarded ipv6 packet */ | ||
size_t diff = sizeof(udp_hdr_t) - nhc_len; | ||
for (int i = nhc_len; i < (udp->size - diff); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently this is the line which is breaking Murdock, but it's strange that Murdock didn't show the error on this check... How can we proceed to this? should I only change the the type of int i
to size_t i
to make Murdock happy? Is this the real cause of Murdock failing everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes. I tried bisecting, #5044 was the commit that breaks compilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's not really broken but it forces NHC to be included by default, on which Murdock fails as the variables are not of the same type. But for me a size_t i = ...
is somehow weird though... But well, it should be fixed somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you can use unsigned i = ...
;-) The error is about signage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #5360 .
adopted #4544
Forwarded packets are not split into multiple snips and the whole payload is left marked (incorrectly?) as
GNRC_NETTYPE_IPV6
after decompressing the 6lowpan information. This patch makes the UDP header compression keep any trailing garbage/payload if the snip was not marked as an UDP header.This fix makes UDP NHC work for my test setup.