mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
gnrc_ndp_node: put next_hop_actual in correct scope
In the if-block the pointer gets free'd as soon as the if-block is exited. This PR prevents that.
This commit is contained in:
parent
5ef0f8d1ff
commit
d731d24d3a
@ -71,11 +71,11 @@ kernel_pid_t gnrc_ndp_node_next_hop_l2addr(uint8_t *l2addr, uint8_t *l2addr_len,
|
|||||||
next_hop_ip = ipv6_ext_rh_next_hop(hdr);
|
next_hop_ip = ipv6_ext_rh_next_hop(hdr);
|
||||||
#endif
|
#endif
|
||||||
#ifdef MODULE_FIB
|
#ifdef MODULE_FIB
|
||||||
|
ipv6_addr_t next_hop_actual; /* FIB copies address into this variable */
|
||||||
/* don't look-up link local addresses in FIB */
|
/* don't look-up link local addresses in FIB */
|
||||||
if (!ipv6_addr_is_link_local(dst)) {
|
if (!ipv6_addr_is_link_local(dst)) {
|
||||||
size_t next_hop_size = sizeof(ipv6_addr_t);
|
size_t next_hop_size = sizeof(ipv6_addr_t);
|
||||||
uint32_t next_hop_flags = 0;
|
uint32_t next_hop_flags = 0;
|
||||||
ipv6_addr_t next_hop_actual; /* FIB copies address into this variable */
|
|
||||||
|
|
||||||
if ((next_hop_ip == NULL) &&
|
if ((next_hop_ip == NULL) &&
|
||||||
(fib_get_next_hop(gnrc_ipv6_fib_table, &iface, next_hop_actual.u8, &next_hop_size,
|
(fib_get_next_hop(gnrc_ipv6_fib_table, &iface, next_hop_actual.u8, &next_hop_size,
|
||||||
|
Loading…
Reference in New Issue
Block a user