Page MenuHomeFreeBSD

D21665.id.diff
No OneTemporary

D21665.id.diff

Index: head/sys/netinet/tcp_output.c
===================================================================
--- head/sys/netinet/tcp_output.c
+++ head/sys/netinet/tcp_output.c
@@ -941,6 +941,20 @@
if (tp->t_flags & TF_NEEDFIN)
sendalot = 1;
} else {
+ if (optlen + ipoptlen >= tp->t_maxseg) {
+ /*
+ * Since we don't have enough space to put
+ * the IP header chain and the TCP header in
+ * one packet as required by RFC 7112, don't
+ * send it. Also ensure that at least one
+ * byte of the payload can be put into the
+ * TCP segment.
+ */
+ SOCKBUF_UNLOCK(&so->so_snd);
+ error = EMSGSIZE;
+ sack_rxmit = 0;
+ goto out;
+ }
len = tp->t_maxseg - optlen - ipoptlen;
sendalot = 1;
if (dont_sendalot)
Index: head/sys/netinet/tcp_stacks/bbr.c
===================================================================
--- head/sys/netinet/tcp_stacks/bbr.c
+++ head/sys/netinet/tcp_stacks/bbr.c
@@ -13343,12 +13343,14 @@
}
} else {
/* Not doing TSO */
- if (optlen + ipoptlen > tp->t_maxseg) {
+ if (optlen + ipoptlen >= tp->t_maxseg) {
/*
* Since we don't have enough space to put
* the IP header chain and the TCP header in
* one packet as required by RFC 7112, don't
- * send it.
+ * send it. Also ensure that at least one
+ * byte of the payload can be put into the
+ * TCP segment.
*/
SOCKBUF_UNLOCK(&so->so_snd);
error = EMSGSIZE;
Index: head/sys/netinet/tcp_stacks/rack.c
===================================================================
--- head/sys/netinet/tcp_stacks/rack.c
+++ head/sys/netinet/tcp_stacks/rack.c
@@ -9200,12 +9200,14 @@
sendalot = 1;
} else {
- if (optlen + ipoptlen > tp->t_maxseg) {
+ if (optlen + ipoptlen >= tp->t_maxseg) {
/*
* Since we don't have enough space to put
* the IP header chain and the TCP header in
* one packet as required by RFC 7112, don't
- * send it.
+ * send it. Also ensure that at least one
+ * byte of the payload can be put into the
+ * TCP segment.
*/
SOCKBUF_UNLOCK(&so->so_snd);
error = EMSGSIZE;

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 6, 10:38 AM (12 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30960374
Default Alt Text
D21665.id.diff (2 KB)

Event Timeline