-
Notifications
You must be signed in to change notification settings - Fork 2.1k
gnrc_ipv6: iface might be from input on next hop determination #3935
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -530,26 +530,26 @@ 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; | ||
| #if defined(MODULE_GNRC_SIXLOWPAN_ND) | ||
| (void)pkt; | ||
| iface = gnrc_sixlowpan_nd_next_hop_l2addr(l2addr, l2addr_len, iface, dst); | ||
| if (iface <= KERNEL_PID_UNDEF) { | ||
| return iface; | ||
| found_iface = gnrc_sixlowpan_nd_next_hop_l2addr(l2addr, l2addr_len, iface, dst); | ||
| if (found_iface > KERNEL_PID_UNDEF) { | ||
| return found_iface; | ||
| } | ||
| #endif | ||
| #if defined(MODULE_GNRC_NDP_NODE) | ||
| if (iface <= KERNEL_PID_UNDEF) { | ||
| iface = gnrc_ndp_node_next_hop_l2addr(l2addr, l2addr_len, iface, dst, pkt); | ||
| } | ||
| found_iface = gnrc_ndp_node_next_hop_l2addr(l2addr, l2addr_len, iface, dst, pkt); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we omit this lookup if
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it found something it just returns in 538 (I reversed the if-statement)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, sorry, overlooked that one. |
||
| #elif !defined(MODULE_GNRC_SIXLOWPAN_ND) | ||
| iface = KERNEL_PID_UNDEF; | ||
| found_iface = KERNEL_PID_UNDEF; | ||
| (void)l2addr; | ||
| (void)l2addr_len; | ||
| (void)iface; | ||
| (void)dst; | ||
| (void)pkt; | ||
| *l2addr_len = 0; | ||
| #endif | ||
| return iface; | ||
| return found_iface; | ||
| } | ||
|
|
||
| static void _send(gnrc_pktsnip_t *pkt, bool prep_hdr) | ||
|
|
||
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#elsepart 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)