Explicitly lock the send socket buffer in spx_reass() to cover the drop

record loop for ACK'd data, rather than relying on lokcing in
sbdroprecord() and sowwakeup(), reducing the number of lock operations
as well as eliminating a possible race against the head of the send
buffer mbuf chain.  Use the _locked variants of sbdroprecord() and
sowwakeup().
This commit is contained in:
Robert Watson 2005-01-02 15:33:13 +00:00
parent 0cdc892230
commit 97270cf1b6

View File

@ -486,13 +486,14 @@ register struct spx *si;
/*
* Trim Acked data from output queue.
*/
SOCKBUF_LOCK(&so->so_snd);
while ((m = so->so_snd.sb_mb) != NULL) {
if (SSEQ_LT((mtod(m, struct spx *))->si_seq, si->si_ack))
sbdroprecord(&so->so_snd);
sbdroprecord_locked(&so->so_snd);
else
break;
}
sowwakeup(so);
sowwakeup_locked(so);
cb->s_rack = si->si_ack;
update_window:
if (SSEQ_LT(cb->s_snxt, cb->s_rack))