]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r262867
authorasomers <asomers@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 27 Mar 2014 16:47:35 +0000 (16:47 +0000)
committerasomers <asomers@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 27 Mar 2014 16:47:35 +0000 (16:47 +0000)
commitdcd057ac78a75c247dcfe571589bed4ece43e3d0
tree7ca11fd8630a5e9a59db28eea6aab48e8dc64016
parent9f5b544589c28db6dc6755d081e71e0986bff8b6
MFC r262867

Fix PR kern/185813 "SOCK_SEQPACKET AF_UNIX sockets with asymmetrical buffers
drop packets".  It was caused by a check for the space available in a
sockbuf, but it was checking the wrong sockbuf.

sys/sys/sockbuf.h
sys/kern/uipc_sockbuf.c
Add sbappendaddr_nospacecheck_locked(), which is just like
sbappendaddr_locked but doesn't validate the receiving socket's space.
Factor out common code into sbappendaddr_locked_internal().  We
shouldn't simply make sbappendaddr_locked check the space and then call
sbappendaddr_nospacecheck_locked, because that would cause the O(n)
function m_length to be called twice.

sys/kern/uipc_usrreq.c
Use sbappendaddr_nospacecheck_locked for SOCK_SEQPACKET sockets,
because the receiving sockbuf's size limit is irrelevant.

tests/sys/kern/unix_seqpacket_test.c
Now that 185813 is fixed, pipe_128k_8k fails intermittently due to
185812.  Make it fail every time by adding a usleep after starting the
writer thread and before starting the reader thread in test_pipe.  That
gives the writer time to fill up its send buffer.  Also, clear the
expected failure message due to 185813.  It actually said "185812", but
that was a typo.

PR: kern/185813

git-svn-id: svn://svn.freebsd.org/base/stable/10@263820 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/uipc_sockbuf.c
sys/kern/uipc_usrreq.c
sys/sys/sockbuf.h
tests/sys/kern/unix_seqpacket_test.c