diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2004-06-24 01:37:04 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2004-06-24 01:37:04 +0000 |
| commit | 3f11a2f3747a7e2a92e1e65558631095508a5599 (patch) | |
| tree | e5101348b9f0100f7efbc938d8137c3daf54ec62 /sys/netinet/tcp_input.c | |
| parent | adb4cf0fbcc101a8e3c0b39ccab53a7474472fbb (diff) | |
Notes
Diffstat (limited to 'sys/netinet/tcp_input.c')
| -rw-r--r-- | sys/netinet/tcp_input.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 581fe9a2ee1e..cab335470748 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2990,6 +2990,7 @@ tcp_mss(tp, offer) * Make the socket buffers an integral number of mss units; * if the mss is larger than the socket buffer, decrease the mss. */ + SOCKBUF_LOCK(&so->so_snd); if ((so->so_snd.sb_hiwat == tcp_sendspace) && metrics.rmx_sendpipe) bufsize = metrics.rmx_sendpipe; else @@ -3001,10 +3002,12 @@ tcp_mss(tp, offer) if (bufsize > sb_max) bufsize = sb_max; if (bufsize > so->so_snd.sb_hiwat) - (void)sbreserve(&so->so_snd, bufsize, so, NULL); + (void)sbreserve_locked(&so->so_snd, bufsize, so, NULL); } + SOCKBUF_UNLOCK(&so->so_snd); tp->t_maxseg = mss; + SOCKBUF_LOCK(&so->so_rcv); if ((so->so_rcv.sb_hiwat == tcp_recvspace) && metrics.rmx_recvpipe) bufsize = metrics.rmx_recvpipe; else @@ -3014,8 +3017,9 @@ tcp_mss(tp, offer) if (bufsize > sb_max) bufsize = sb_max; if (bufsize > so->so_rcv.sb_hiwat) - (void)sbreserve(&so->so_rcv, bufsize, so, NULL); + (void)sbreserve_locked(&so->so_rcv, bufsize, so, NULL); } + SOCKBUF_UNLOCK(&so->so_rcv); /* * While we're here, check the others too */ |
