Hey Paul,
Thanks for the report!
On 06/03/17(Mon) 12:13, Paul de Weerd wrote:
> [...]
> This weekend my workstation lost v6 connectivity. I didn't notice, as
> I wasn't around (social commitments), but my backup script did.
> Investigating this problem, it looks like ndp lost the entry for the
> default gateway:
>
> $ netstat -rnf inet6 | awk '/^default/'
> default fe80::260:e0ff:fe52:f96%em0 UG 0 6880 - 56 em0
> $ ndp -an | grep `netstat -rnf inet6 | awk '/^default/ {print $2}'`
> fe80::260:e0ff:fe52:f96%em0 00:60:e0:52:0f:96 em0 expired I R 3
^^
That's the key of the problem
>
> Deleting the expired entry doesn't seem very effective:
It *is* effective since it solved your problem. A cached entry, like
the one referenced by your default route is no longer 'deleted' it is
'flushed'. In practice it doesn't change much since such entries are
created automagically. But you found a bug!
Diff below should solve that by resetting the 'asked' counter and allow
our NDP code to generate a new NS. Just like the delete command does.
> [...]
> What else can I do to further debug this issue?
Next time this happen use tcpdump(8) and filter NS packets. Try sending
a single packet using ping and see if/when a new NS is sent.
Index: netinet6/nd6.c
===================================================================
RCS file: /cvs/src/sys/netinet6/nd6.c,v
retrieving revision 1.205
diff -u -p -r1.205 nd6.c
--- netinet6/nd6.c 3 Mar 2017 08:01:59 -0000 1.205
+++ netinet6/nd6.c 6 Mar 2017 12:02:53 -0000
@@ -834,7 +834,9 @@ nd6_free(struct rtentry *rt, int gc)
* caches, and disable the route entry not to be used in already
* cached routes.
*/
- if (!ISSET(rt->rt_flags, RTF_STATIC|RTF_CACHED))
+ if (ISSET(rt->rt_flags, RTF_CACHED))
+ nd6_invalidate(rt);
+ else if (!ISSET(rt->rt_flags, RTF_STATIC))
rtdeletemsg(rt, ifp, ifp->if_rdomain);
if_put(ifp);