From 8451feaa7a48dd7b161a98504ec8414e8b2e5fa5 Mon Sep 17 00:00:00 2001 From: Ivan Delamer Date: Wed, 18 Mar 2015 12:22:49 -0600 Subject: [PATCH] fixed bug #42885 nd6_reachability_hint() accepts an address of an unknown neighbour --- src/core/ipv6/nd6.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/ipv6/nd6.c b/src/core/ipv6/nd6.c index 1022a41c..e27ba019 100644 --- a/src/core/ipv6/nd6.c +++ b/src/core/ipv6/nd6.c @@ -1798,6 +1798,11 @@ nd6_reachability_hint(const ip6_addr_t * ip6addr) return; } + /* For safety: don't set as reachable if we don't have a LL address yet. Misuse protection. */ + if (neighbor_cache[i].state == ND6_INCOMPLETE || neighbor_cache[i].state == ND6_NO_ENTRY) { + return; + } + /* Set reachability state. */ neighbor_cache[i].state = ND6_REACHABLE; neighbor_cache[i].counter.reachable_time = reachable_time;