Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/tcp_input.c
Show First 20 Lines • Show All 3,752 Lines • ▼ Show 20 Lines | tcp_mss(struct tcpcb *tp, int offer) | ||||
else { | else { | ||||
bufsize = roundup(bufsize, mss); | bufsize = roundup(bufsize, mss); | ||||
if (bufsize > sb_max) | if (bufsize > sb_max) | ||||
bufsize = sb_max; | bufsize = sb_max; | ||||
if (bufsize > so->so_snd.sb_hiwat) | if (bufsize > so->so_snd.sb_hiwat) | ||||
(void)sbreserve_locked(&so->so_snd, bufsize, so, NULL); | (void)sbreserve_locked(&so->so_snd, bufsize, so, NULL); | ||||
} | } | ||||
SOCKBUF_UNLOCK(&so->so_snd); | SOCKBUF_UNLOCK(&so->so_snd); | ||||
tp->t_maxseg = mss; | /* | ||||
* Sanity check: make sure that maxseg will be large | |||||
* enough to allow some data on segments even if the | |||||
* all the option space is used (40bytes). Otherwise | |||||
* funny things may happen in tcp_output. | |||||
* | |||||
* XXXGL: shouldn't we reserve space for IP/IPv6 options? | |||||
*/ | |||||
tp->t_maxseg = max(mss, 64); | |||||
SOCKBUF_LOCK(&so->so_rcv); | SOCKBUF_LOCK(&so->so_rcv); | ||||
if ((so->so_rcv.sb_hiwat == V_tcp_recvspace) && metrics.rmx_recvpipe) | if ((so->so_rcv.sb_hiwat == V_tcp_recvspace) && metrics.rmx_recvpipe) | ||||
bufsize = metrics.rmx_recvpipe; | bufsize = metrics.rmx_recvpipe; | ||||
else | else | ||||
bufsize = so->so_rcv.sb_hiwat; | bufsize = so->so_rcv.sb_hiwat; | ||||
if (bufsize > mss) { | if (bufsize > mss) { | ||||
bufsize = roundup(bufsize, mss); | bufsize = roundup(bufsize, mss); | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |