summaryrefslogtreecommitdiff
path: root/sys/net/if_tun.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-15 01:40:59 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-15 01:40:59 +0000
commit12215d5eabf89ca29198ee135b78a60155102f35 (patch)
treea806cc40f60789e7e3f674993b502c5cf556ad58 /sys/net/if_tun.c
parent2b3d1887ac6c72f8273969f0b739fb622d7c5c0e (diff)
use m_pkthdr.len for FIONREAD, correctly indicates how much data is available
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r--sys/net/if_tun.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index dcd59335bcc..0e096f1bf20 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tun.c,v 1.18 1995/06/13 05:59:37 mycroft Exp $ */
+/* $NetBSD: if_tun.c,v 1.19 1995/12/13 23:47:40 pk Exp $ */
/*
* Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
@@ -360,7 +360,7 @@ tuncioctl(dev, cmd, data, flag, p)
case FIONREAD:
s = splimp();
if (tp->tun_if.if_snd.ifq_head)
- *(int *)data = tp->tun_if.if_snd.ifq_head->m_len;
+ *(int *)data = tp->tun_if.if_snd.ifq_head->m_pkthdr.len;
else
*(int *)data = 0;
splx(s);
@@ -428,6 +428,8 @@ tunread(dev, uio)
TUNDEBUG("Dropping mbuf\n");
m_freem(m0);
}
+ if (error)
+ ifp->if_ierrors++;
return error;
}
@@ -478,6 +480,7 @@ tunwrite(dev, uio)
if (error) {
if (top)
m_freem (top);
+ ifp->if_ierrors++;
return error;
}