From e6a483abe8714d9f5a6bf02c54271110553c9dc1 Mon Sep 17 00:00:00 2001 From: dlg Date: Wed, 7 Feb 2018 05:59:00 +0000 Subject: [PATCH] take the interface down if it is being destroyed. --- sys/net/if_mobileip.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/net/if_mobileip.c b/sys/net/if_mobileip.c index 80a111adc05..28f8bbbefd2 100644 --- a/sys/net/if_mobileip.c +++ b/sys/net/if_mobileip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mobileip.c,v 1.1 2018/02/07 01:09:57 dlg Exp $ */ +/* $OpenBSD: if_mobileip.c,v 1.2 2018/02/07 05:59:00 dlg Exp $ */ /* * Copyright (c) 2016 David Gwynne @@ -147,6 +147,11 @@ mobileip_clone_destroy(struct ifnet *ifp) if_detach(ifp); + NET_LOCK(); + if (ISSET(ifp->if_flags, IFF_RUNNING)) + mobileip_down(sc); + NET_UNLOCK(); + free(sc, M_DEVBUF, sizeof(*sc)); return (0); -- 2.20.1