diff options
author | tjr <tjr@FreeBSD.org> | 2003-01-11 07:51:52 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-01-11 07:51:52 +0000 |
commit | 1a26cd3da49a6f412ad7131f6a447fe3d7b75b5a (patch) | |
tree | e2ae70eaca08d89d99bfa8de7edb5739ce571452 /sys/kern/uipc_socket2.c | |
parent | 187e654d9ab8b270eb7ce255f4014e7a97b9298b (diff) | |
download | FreeBSD-src-1a26cd3da49a6f412ad7131f6a447fe3d7b75b5a.zip FreeBSD-src-1a26cd3da49a6f412ad7131f6a447fe3d7b75b5a.tar.gz |
Don't count mbufs with m_type == MT_HEADER or MT_OOBDATA as control data
in sballoc(), sbcompress(), sbdrop() and sbfree(). Fixes fstat() st_size
reporting and kevent() EVFILT_READ on TCP sockets.
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r-- | sys/kern/uipc_socket2.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index f652b5a..3283b58 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -705,7 +705,9 @@ sbcompress(sb, m, n) (unsigned)m->m_len); n->m_len += m->m_len; sb->sb_cc += m->m_len; - if (m->m_type != MT_DATA) /* XXX: Probably don't need.*/ + if (m->m_type != MT_DATA && m->m_type != MT_HEADER && + m->m_type != MT_OOBDATA) + /* XXX: Probably don't need.*/ sb->sb_ctl += m->m_len; m = m_free(m); continue; @@ -776,7 +778,8 @@ sbdrop(sb, len) m->m_len -= len; m->m_data += len; sb->sb_cc -= len; - if (m->m_type != MT_DATA) + if (m->m_type != MT_DATA && m->m_type != MT_HEADER && + m->m_type != MT_OOBDATA) sb->sb_ctl -= len; break; } |