From 177bb6ca06040ace460d6ba80dd5f0de580879ea Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Mon, 3 Feb 2020 20:57:28 +0100 Subject: [PATCH] nd6: update addr_hint only if the index has actually changed --- src/core/ipv6/nd6.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/ipv6/nd6.c b/src/core/ipv6/nd6.c index 9cafd483..8f168438 100644 --- a/src/core/ipv6/nd6.c +++ b/src/core/ipv6/nd6.c @@ -2008,14 +2008,13 @@ nd6_get_next_hop_entry(const ip6_addr_t *ip6addr, struct netif *netif) ip6_addr_copy(destination_cache[nd6_cached_destination_index].next_hop_addr, default_router_list[i].neighbor_entry->next_hop_address); } } - } - #if LWIP_NETIF_HWADDRHINT - if (netif->hints != NULL) { - /* per-pcb cached entry was given */ - netif->hints->addr_hint = nd6_cached_destination_index; - } + if (netif->hints != NULL) { + /* per-pcb cached entry was given */ + netif->hints->addr_hint = nd6_cached_destination_index; + } #endif /* LWIP_NETIF_HWADDRHINT */ + } /* Look in neighbor cache for the next-hop address. */ if (ip6_addr_cmp(&(destination_cache[nd6_cached_destination_index].next_hop_addr),