summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2020-04-22 07:51:39 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2020-04-22 07:51:39 +0000
commit85483a5fe416b07ee64282fb0c0da8050f729205 (patch)
treee762b7ef2bb5c78ce2963c007edb887d29e8d31e
parent45e53e6f9250cd374784fab1c94f7beb6468f9e2 (diff)
Assert that ND6 timer is never set for RTF_LOCAL routes.
Such routes have a valid link-local entry that should not be overwritten. The current assert in the timeout routine doesn't give enough information to know where the bug is, if there is still one. This should play better with syzkaller. ok claudio@, visa@ as part of a larger diff
-rw-r--r--sys/netinet6/nd6.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 622a3234514..2b90caa37c7 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.230 2020/04/22 07:45:31 mpi Exp $ */
+/* $OpenBSD: nd6.c,v 1.231 2020/04/22 07:51:38 mpi Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -306,6 +306,7 @@ nd6_llinfo_settimer(struct llinfo_nd6 *ln, unsigned int secs)
time_t expire = time_uptime + secs;
NET_ASSERT_LOCKED();
+ KASSERT(!ISSET(ln->ln_rt->rt_flags, RTF_LOCAL));
ln->ln_rt->rt_expire = expire;
if (!timeout_pending(&nd6_timer_to) || expire < nd6_timer_next) {