summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1995-12-11 13:24:58 +0000
committerPeter Wemm <peter@FreeBSD.org>1995-12-11 13:24:58 +0000
commit8c1f170b9009d4ce42300e156a35e67467f3f26a (patch)
tree63e57ac213a78a36778e0a60e506d9af6f437fbf
parent6d41b96fd71c968cfadd3615d9e10b676a192cc4 (diff)
Notes
-rw-r--r--sys/net/if_tun.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 675995ffd7f9..a9db86014faf 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -431,9 +431,11 @@ tunioctl(dev, cmd, data, flag, p)
break;
case FIONREAD:
s = splimp();
- if (tp->tun_if.if_snd.ifq_head)
- *(int *)data = tp->tun_if.if_snd.ifq_head->m_len;
- else
+ if (tp->tun_if.if_snd.ifq_head) {
+ struct mbuf *mb = tp->tun_if.if_snd.ifq_head;
+ for( *(int *)data = 0; mb != 0; mb = mb->m_next)
+ *(int *)data += mb->m_len;
+ } else
*(int *)data = 0;
splx(s);
break;