-
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
fix@nhc-on-br #4544
fix@nhc-on-br #4544
Conversation
gnrc_pktbuf_realloc_data(udp, nhc_len); | ||
|
||
if (udp->type == GNRC_NETTYPE_IPV6) { | ||
/* forwarded ipv6 packet */ |
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.
Wouldn't it be better to mark the UDP header properly before encoding in this case?
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.
Had it in my head, I think yes.
@jfischer-phytec-iot just tested this. CoAP seems to work for my setup with your fix. I can CoAP ping the 6lr and I can request "/riot/board". Requesting "/.well-known/core" however does not work very reliably. What about you? |
requesting well-known does only seem to work for the first time, then I need to reboot the 6lr to request it again |
this can also be an unrelated issue though. |
I have only tested "/riot/board". I had to interrupt ... 🔍 -> 🎁. I will continue tonight. |
It seems that CoAP requests do not work if they are big enough to get fragmented by 6lo. Requesting |
@cgundogan Do ping6 with increased payload works?
|
@cgundogan @authmillenon For fragmented packets, rbuf_add fails after gnrc_sixlowpan_iphc_decode, because |
Hm, so with this PR, NHC messes up fragmentation? Maybe drop NHC for the release? Taking a while to fix... |
jaein, it was created by me, I missed it in the implementation. @OlegHahm @cgundogan @kaspar030 @authmillenon |
@authmillenon no, not at https://github.com/RIOT-OS/RIOT/blob/master/sys/net/gnrc/network_layer/sixlowpan/frag/rbuf.c#L114
I think |
You mean for IPv6 header? |
And that's totally broken indeed. |
But given my implementation of IPv6 and of 6LoWPAN IPHC I guess reallocing the IPv6 header was what I had originally in mind for NHC. |
if (_align(pkt->size) > aligned_size) { | ||
_pktbuf_free(((uint8_t *)pkt->data) + aligned_size, | ||
pkt->size - aligned_size); | ||
} |
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'm not sure if this could generate fragmentation in the packet buffer. When is this part free'd otherwise?
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.
@authmillenon moved to #4602
@jfischer-phytec-iot ping6 with bigger payload does work with your PR merged into master. However, CoAP still breaks if packets get fragmented. |
I will label this PR for the next release, because I don't think that this will be fixed within the following days. @authmillenon @jfischer-phytec-iot opinions? |
👍 |
@jfischer-phytec-iot What is the status of this PR? |
/* shrink udp allocation to final size */ | ||
gnrc_pktbuf_realloc_data(udp, nhc_len); | ||
|
||
if (udp->type == GNRC_NETTYPE_IPV6) { |
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.
shouldn't this be if (udp->type != GNRC_NETTYPE_UDP) {
?
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 don't know, since I honestly don't know what state the packet is in at this point.
I think this PR needs a rebase. |
(several PRs mentioned in this PR were merged, though there is no merge conflict). |
@authmillenon what do you think about my comment above?
I can adopt this PR and rebase on master if you want? |
Gave an answer ;-)
@jfischer-phytec-iot are you okay with that? |
@jfischer-phytec-iot seems to be inactive at the moment. @gebart can you please adapt for the release? |
I'm off on holidays at the moment, but I might be able to do this during
|
Postponed for next release. |
Why postponing? I think this is important. |
But nobody is able to work on it at the moment as it seems... |
posted a rebased PR #5232 |
#5232 was merged, so I close this one |
This PR fixes the UDP transmission from a RIOT-br to a RIOT-node.
The problem is that the forwarded packet has no nested structure (such as a packet generated on the node, for example, pkt->next-> next-> type == GNRC_NETTYPE_UDP).
fix for testing, see #4462
Tested on PhyNode(pba-d-01-kw2x) as BR and PhyNode as node (microcoap_server).