summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2018-12-11 01:34:11 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2018-12-11 01:34:11 +0000
commit9fb2f8d8d5736a6c53e25cdc82fe4f512fddbcea (patch)
treea36f46da74bf85fc46fcb581ac53b41aeb48bba4 /sys
parentf49fcc57520c73c5e21307a3aac9ba5c27a9e5af (diff)
use ifq_hdatalen for handling the FIONREAD ioctl
ok stsp@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_tun.c5
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;