gnrc_ipv6: iface might be from input on next hop determination#3935
Conversation
aefb74f to
6fef744
Compare
|
Actually… we don't need #3931 at all… The if-return in https://github.com/RIOT-OS/RIOT/pull/3935/files#diff-74976d45a42eaa063e3561b5fd36f615R536-538 assures already, that the function is exited before the next hop determination of standard IPv6 is called.... |
|
Some fine reviewing I did there 😞 |
|
The if-return is only for the error-case. #3931 is required - I actually ran into problems with this. |
|
Okay let's write the code from #3931 with the assumption that all (void)pkt;
iface = gnrc_sixlowpan_nd_next_hop_l2addr(l2addr, l2addr_len, iface, dst);
if (iface <= KERNEL_PID_UNDEF) {
return iface;
}
if (iface <= KERNEL_PID_UNDEF) {
iface = gnrc_ndp_node_next_hop_l2addr(l2addr, l2addr_len, iface, dst, pkt);
}Do you see what I'm getting at? Two times the same check, the first results in returning. So how could iface be |
|
(except if it was given on input). |
|
It is about the case where |
|
We're setting the interface twice in this case and apparently the later setting overwrites the first one in a wrong manner. |
|
Ahhh… now I see what you mean… okay I revert this PR to its original state. |
6fef744 to
aefb74f
Compare
|
Done |
There was a problem hiding this comment.
If you initialize this with KERNEL_PID_UNDEF, you can save the #else part in line 540/541.
There was a problem hiding this comment.
See fixup (and I did this because otherwise cppcheck would have been complaining)
|
Please squash |
04878de to
5d75016
Compare
|
Squashed |
…-from-input gnrc_ipv6: iface might be from input on next hop determination
|
Technically there was no ACK, but should be fine anyway. |
|
Sorry 😞 |
Fixes #3931 (comment).