summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2020-01-08 09:09:11 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2020-01-08 09:09:11 +0000
commit22974506393f1f9250c25b529c9a12a19d235e97 (patch)
tree3660d1131658b954a4224de880c5da9a91de44e5 /sys
parentdbb1cc7e79cae6d9483228fb1ad9cadbb427ff0e (diff)
In loop_clone_destroy() reset the rdomain with rtable_l2set() after
the if_detach() call. In if_detach() various route messages are generated and during that time the rtable_l2() mapping needs to stay. OK kn@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_loop.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 1295387fe9c..1d3a8095b0e 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_loop.c,v 1.89 2019/08/06 22:57:54 bluhm Exp $ */
+/* $OpenBSD: if_loop.c,v 1.90 2020/01/08 09:09:10 claudio Exp $ */
/* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */
/*
@@ -196,6 +196,7 @@ int
loop_clone_destroy(struct ifnet *ifp)
{
struct ifnet *p;
+ unsigned int rdomain = 0;
if (ifp->if_index == rtable_loindex(ifp->if_rdomain)) {
/* rdomain 0 always needs a loopback */
@@ -214,13 +215,16 @@ loop_clone_destroy(struct ifnet *ifp)
}
NET_UNLOCK();
- rtable_l2set(ifp->if_rdomain, 0, 0);
+ rdomain = ifp->if_rdomain;
}
if_ih_remove(ifp, loinput, NULL);
if_detach(ifp);
free(ifp, M_DEVBUF, sizeof(*ifp));
+
+ if (rdomain)
+ rtable_l2set(rdomain, 0, 0);
return (0);
}