diff options
author | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2004-11-11 10:42:05 +0000 |
---|---|---|
committer | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2004-11-11 10:42:05 +0000 |
commit | cf72d011f419c95af087023e65a21266372e8cc1 (patch) | |
tree | bec0a64e448ccfbe34e1357230f140804f6c0b2e /sys | |
parent | 7fd8b0a80dd57542860d3e31ca8608a1c76db1db (diff) |
Check IFF_UP at tun_output().
ok henning, markus.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_tun.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index f56fa1b258d..327006bde8e 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.63 2004/11/09 14:15:40 henning Exp $ */ +/* $OpenBSD: if_tun.c,v 1.64 2004/11/11 10:42:04 mpf Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -568,6 +568,11 @@ tun_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, int s, len, error; u_int32_t *af; + if (!(ifp->if_flags & IFF_UP)) { + m_freem(m0); + return (EHOSTDOWN); + } + TUNDEBUG(("%s: tun_output\n", ifp->if_xname)); if ((tp->tun_flags & TUN_READY) != TUN_READY) { |