From 6348db95fee38838b8a1c84da21c8ca561ba9538 Mon Sep 17 00:00:00 2001 From: bluhm Date: Mon, 15 Jan 2018 13:48:31 +0000 Subject: [PATCH] There was an issue that dynamic path MTU discovery together with ARP or ND timeout could delete local routes. Put an assert into arptfree() and nd6_free() so this cannot happen again. OK mpi@ --- sys/netinet/if_ether.c | 3 ++- sys/netinet6/nd6.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index f1de465e4d3..ef28b67808e 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.231 2017/08/11 21:24:19 mpi Exp $ */ +/* $OpenBSD: if_ether.c,v 1.232 2018/01/15 13:48:31 bluhm Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -694,6 +694,7 @@ arptfree(struct rtentry *rt) { struct ifnet *ifp; + KASSERT(!ISSET(rt->rt_flags, RTF_LOCAL)); arpinvalidate(rt); ifp = if_get(rt->rt_ifidx); diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 8b0b3d88215..9da9635f26f 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.222 2017/11/27 15:41:30 mpi Exp $ */ +/* $OpenBSD: nd6.c,v 1.223 2018/01/15 13:48:31 bluhm Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -722,6 +722,7 @@ nd6_free(struct rtentry *rt) } } + KASSERT(!ISSET(rt->rt_flags, RTF_LOCAL)); nd6_invalidate(rt); /* -- 2.20.1