Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110611853
D21666.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21666.id.diff
View Options
Index: head/sys/netinet/tcp_stacks/rack.c
===================================================================
--- head/sys/netinet/tcp_stacks/rack.c
+++ head/sys/netinet/tcp_stacks/rack.c
@@ -7840,7 +7840,16 @@
hdrlen += sizeof(struct udphdr);
}
#endif
- ipoptlen = 0;
+#ifdef INET6
+ if (isipv6)
+ ipoptlen = ip6_optlen(tp->t_inpcb);
+ else
+#endif
+ if (tp->t_inpcb->inp_options)
+ ipoptlen = tp->t_inpcb->inp_options->m_len -
+ offsetof(struct ipoption, ipopt_list);
+ else
+ ipoptlen = 0;
#if defined(IPSEC) || defined(IPSEC_SUPPORT)
ipoptlen += ipsec_optlen;
#endif
@@ -7913,6 +7922,18 @@
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.
+ */
+ SOCKBUF_UNLOCK(&so->so_snd);
+ error = EMSGSIZE;
+ sack_rxmit = 0;
+ goto out;
+ }
len = tp->t_maxseg - optlen - ipoptlen;
sendalot = 1;
}
@@ -8414,15 +8435,9 @@
m->m_pkthdr.csum_flags |= CSUM_TSO;
m->m_pkthdr.tso_segsz = tp->t_maxseg - optlen;
}
-#if defined(IPSEC) || defined(IPSEC_SUPPORT)
- KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL),
- ("%s: mbuf chain shorter than expected: %d + %u + %u - %u != %u",
- __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL)));
-#else
- KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL),
- ("%s: mbuf chain shorter than expected: %d + %u + %u != %u",
- __func__, len, hdrlen, ipoptlen, m_length(m, NULL)));
-#endif
+ KASSERT(len + hdrlen == m_length(m, NULL),
+ ("%s: mbuf chain different than expected: %d + %u != %u",
+ __func__, len, hdrlen, m_length(m, NULL)));
#ifdef TCP_HHOOK
/* Run HHOOK_TCP_ESTABLISHED_OUT helper hooks. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 21, 9:35 PM (2 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16759184
Default Alt Text
D21666.id.diff (1 KB)
Attached To
Mode
D21666: Let the RACK stack take IP options into account when computing the space for user data in TCP segments
Attached
Detach File
Event Timeline
Log In to Comment