1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_ndp: only lookup non-link-local addresses in FIB

This commit is contained in:
Martine Lenders 2015-08-13 21:27:43 +02:00
parent 2206e877e8
commit b82f11be81

View File

@ -59,24 +59,27 @@ kernel_pid_t ng_ndp_node_next_hop_l2addr(uint8_t *l2addr, uint8_t *l2addr_len,
kernel_pid_t iface, ipv6_addr_t *dst,
ng_pktsnip_t *pkt)
{
ng_ipv6_nc_t *nc_entry;
ipv6_addr_t *next_hop_ip = NULL, *prefix = NULL;
#ifdef MODULE_NG_IPV6_EXT_RH
next_hop_ip = ng_ipv6_ext_rh_next_hop(hdr);
#endif
#ifdef MODULE_FIB
size_t next_hop_size = sizeof(ipv6_addr_t);
uint32_t next_hop_flags = 0;
ipv6_addr_t next_hop_actual; /* FIB copies address into this variable */
/* don't look-up link local addresses in FIB */
if (!ipv6_addr_is_link_local(dst)) {
size_t next_hop_size = sizeof(ipv6_addr_t);
uint32_t next_hop_flags = 0;
ipv6_addr_t next_hop_actual; /* FIB copies address into this variable */
if ((next_hop_ip == NULL) &&
(fib_get_next_hop(&iface, next_hop_actual.u8, &next_hop_size,
&next_hop_flags, (uint8_t *)dst,
sizeof(ipv6_addr_t), 0) >= 0) &&
(next_hop_size == sizeof(ipv6_addr_t))) {
next_hop_ip = &next_hop_actual;
if ((next_hop_ip == NULL) &&
(fib_get_next_hop(&iface, next_hop_actual.u8, &next_hop_size,
&next_hop_flags, (uint8_t *)dst,
sizeof(ipv6_addr_t), 0) >= 0) &&
(next_hop_size == sizeof(ipv6_addr_t))) {
next_hop_ip = &next_hop_actual;
}
}
#endif
if ((next_hop_ip == NULL)) { /* no route to host */