Skip to content
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

ng_ndp: cache determined next-hop in FIB #3148

Merged
merged 1 commit into from
Jul 2, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions sys/net/network_layer/ng_ndp/ng_ndp.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ void ng_ndp_retrans_nbr_sol(ng_ipv6_nc_t *nc_entry)
ng_ipv6_addr_to_str(addr_str, &nc_entry->ipv6_addr, sizeof(addr_str)),
nc_entry->iface);

#ifdef MODULE_FIB
fib_remove_entry((uint8_t *)&(nc_entry->ipv6_addr), sizeof(ng_ipv6_addr_t));
#endif
ng_ipv6_nc_remove(nc_entry->iface, &nc_entry->ipv6_addr);
}
}
Expand Down Expand Up @@ -441,11 +444,25 @@ kernel_pid_t ng_ndp_next_hop_l2addr(uint8_t *l2addr, uint8_t *l2addr_len,
(ng_ipv6_netif_addr_get(prefix)->flags &
NG_IPV6_NETIF_ADDR_FLAGS_NDP_ON_LINK)) {
next_hop_ip = dst;
#ifdef MODULE_FIB
/* We don't care if FIB is full, this is just for efficiency
* for later sends */
fib_add_entry(iface, (uint8_t *)dst, sizeof(ng_ipv6_addr_t), 0,
(uint8_t *)next_hop_ip, sizeof(ng_ipv6_addr_t), 0,
FIB_LIFETIME_NO_EXPIRE);
#endif
}
}

if (next_hop_ip == NULL) {
next_hop_ip = _default_router();
#ifdef MODULE_FIB
/* We don't care if FIB is full, this is just for efficiency for later
* sends */
fib_add_entry(iface, (uint8_t *)dst, sizeof(ng_ipv6_addr_t), 0,
(uint8_t *)next_hop_ip, sizeof(ng_ipv6_addr_t), 0,
FIB_LIFETIME_NO_EXPIRE);
#endif
}

if (next_hop_ip != NULL) {
Expand Down