From e0ab8c581d0effa4d7a3095b0e3a16fcc6fbb127 Mon Sep 17 00:00:00 2001 From: sg Date: Sat, 5 Mar 2016 14:11:24 +0100 Subject: [PATCH] fixed bug #46093: Move IP6_ROUTE() hook to after LL processing --- src/core/ipv6/ip6.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/core/ipv6/ip6.c b/src/core/ipv6/ip6.c index 24a5f622..380bc290 100644 --- a/src/core/ipv6/ip6.c +++ b/src/core/ipv6/ip6.c @@ -81,13 +81,6 @@ ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest) struct netif *netif; s8_t i; -#ifdef LWIP_HOOK_IP6_ROUTE - netif = LWIP_HOOK_IP6_ROUTE(src, dest); - if (netif != NULL) { - return netif; - } -#endif - /* If single netif configuration, fast return. */ if ((netif_list != NULL) && (netif_list->next == NULL)) { if (!netif_is_up(netif_list) || !netif_is_link_up(netif_list)) { @@ -126,6 +119,14 @@ ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest) return netif_default; } + /* we come here for non-link-local addresses */ +#ifdef LWIP_HOOK_IP6_ROUTE + netif = LWIP_HOOK_IP6_ROUTE(src, dest); + if (netif != NULL) { + return netif; + } +#endif + /* See if the destination subnet matches a configured address. */ for (netif = netif_list; netif != NULL; netif = netif->next) { if (!netif_is_up(netif) || !netif_is_link_up(netif)) {