diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2018-12-11 01:34:11 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2018-12-11 01:34:11 +0000 |
commit | 9fb2f8d8d5736a6c53e25cdc82fe4f512fddbcea (patch) | |
tree | a36f46da74bf85fc46fcb581ac53b41aeb48bba4 | |
parent | f49fcc57520c73c5e21307a3aac9ba5c27a9e5af (diff) |
use ifq_hdatalen for handling the FIONREAD ioctl
ok stsp@
-rw-r--r-- | sys/net/if_tun.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index e08bb61a52d..5675650c7b3 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.182 2018/11/12 06:35:37 dlg Exp $ */ +/* $OpenBSD: if_tun.c,v 1.183 2018/12/11 01:34:10 dlg Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -670,8 +670,7 @@ tun_dev_ioctl(struct tun_softc *tp, u_long cmd, caddr_t data, int flag, tp->tun_flags &= ~TUN_ASYNC; break; case FIONREAD: - *(int *)data = ifq_empty(&tp->tun_if.if_snd) ? - 0 : tp->tun_if.if_mtu; + *(int *)data = ifq_hdatalen(&tp->tun_if.if_snd); break; case TIOCSPGRP: tp->tun_pgid = *(int *)data; |