-
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_ipv6: iface might be from input on next hop determination #3935
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 |
@@ -530,26 +530,29 @@ static inline kernel_pid_t _next_hop_l2addr(uint8_t *l2addr, uint8_t *l2addr_len | |||
kernel_pid_t iface, ipv6_addr_t *dst, | |||
gnrc_pktsnip_t *pkt) | |||
{ | |||
kernel_pid_t found_iface; |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).