net/lwip : remove route to default router
This commit is patch to remove route to default router
- if there is no matched default router, NUD is needed to find
next-hop address
- previously, NUD doesn't be progressed since new route is configured
through default router
@@ -1905,19 +1905,10 @@ static s8_t nd6_get_next_hop_entry(const ip6_addr_t *ip6addr, struct netif *neti
/* destination address in destination cache can be off-link address */
if (!ip6_addr_islinklocal(ip6addr) && !nd6_is_prefix_in_netif(ip6addr, netif)) {
i = nd6_get_router(&destination_cache[nd6_cached_destination_index].next_hop_addr, netif);
- if (i < 0) {
- /* off-link address - We need to select a router. */
- i = nd6_select_router(ip6addr, netif);
- if (i < 0) {
- /* No router found. */
- ip6_addr_set_any(&(destination_cache[nd6_cached_destination_index].destination_addr));
- return ERR_RTE;
+ if (i > 0) {
+ LWIP_DEBUGF(ND6_DEBUG, ("Found router, send through default router index %d\n", i));
} else {
-
- LWIP_DEBUGF(ND6_DEBUG, ("Next-hop address of off-link desination address is default router (index = %d)\n", i));
- destination_cache[nd6_cached_destination_index].pmtu = netif->mtu; /* Start with netif mtu, correct through ICMPv6 if necessary */
- ip6_addr_copy(destination_cache[nd6_cached_destination_index].next_hop_addr, default_router_list[i].neighbor_entry->next_hop_address);
- }
+ LWIP_DEBUGF(ND6_DEBUG, ("Failed to find router, need to NUD\n"));
}
}
} else {
