summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-05-27 13:18:28 +0000
committerBrian Somers <brian@FreeBSD.org>1999-05-27 13:18:28 +0000
commit42c4682dd95e8fd12b2d5faadd3e0d6f24ff684a (patch)
tree94ba8b1909317a94ef1c6e00cca584510f5ab2d3 /sys/net
parentca4449cf8c20628a4cb2c9e1d5f5e11666e51838 (diff)
downloadsrc-test2-42c4682dd95e8fd12b2d5faadd3e0d6f24ff684a.tar.gz
src-test2-42c4682dd95e8fd12b2d5faadd3e0d6f24ff684a.zip
Notes
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_tun.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 181fa86a0d82..e5539491824e 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -197,19 +197,23 @@ tunclose(dev, foo, bar, p)
if (ifp->if_flags & IFF_UP) {
s = splimp();
if_down(ifp);
- if (ifp->if_flags & IFF_RUNNING) {
- /* find internet addresses and delete routes */
- register struct ifaddr *ifa;
- for (ifa = ifp->if_addrhead.tqh_first; ifa;
- ifa = ifa->ifa_link.tqe_next) {
- if (ifa->ifa_addr->sa_family == AF_INET) {
- rtinit(ifa, (int)RTM_DELETE,
- tp->tun_flags & TUN_DSTADDR ? RTF_HOST : 0);
- }
- }
- }
splx(s);
}
+
+ if (ifp->if_flags & IFF_RUNNING) {
+ register struct ifaddr *ifa;
+
+ s = splimp();
+ /* find internet addresses and delete routes */
+ for (ifa = ifp->if_addrhead.tqh_first; ifa;
+ ifa = ifa->ifa_link.tqe_next)
+ if (ifa->ifa_addr->sa_family == AF_INET)
+ rtinit(ifa, (int)RTM_DELETE,
+ tp->tun_flags & TUN_DSTADDR ? RTF_HOST : 0);
+ ifp->if_flags &= ~IFF_RUNNING;
+ splx(s);
+ }
+
funsetown(tp->tun_sigio);
selwakeup(&tp->tun_rsel);