From 18fcafa53aa145d5a4be0a08d17c6d8c0a76d7eb Mon Sep 17 00:00:00 2001 From: Florian Obser Date: Wed, 6 Jan 2021 08:10:16 +0000 Subject: Mark a layer 2 address as expired by setting the length to 0 when the associated IPv6 NDP entry is invalidated. Otherwise we end up with an INCOMPLETE entry that can't be updated to STALE and REACHABLE by neighbor advertisements and thus interrupting communication. This is the same as arpinvalidate() for IPv4. Guidance bluhm & claudio, fix proposed by claudio OK claudio --- sys/netinet6/nd6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/netinet6') diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 4fb528b2a28..c6302b64a29 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.233 2020/06/24 22:03:44 cheloha Exp $ */ +/* $OpenBSD: nd6.c,v 1.234 2021/01/06 08:10:15 florian Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -690,8 +690,10 @@ void nd6_invalidate(struct rtentry *rt) { struct llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo; + struct sockaddr_dl *sdl = satosdl(rt->rt_gateway); m_freem(ln->ln_hold); + sdl->sdl_alen = 0; ln->ln_hold = NULL; ln->ln_state = ND6_LLINFO_INCOMPLETE; ln->ln_asked = 0; -- cgit v1.2.3