Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144368466
D7415.id19031.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
D7415.id19031.diff
View Options
Index: sys/netinet/tcp_lro.c
===================================================================
--- sys/netinet/tcp_lro.c
+++ sys/netinet/tcp_lro.c
@@ -603,6 +603,7 @@
int error, ip_len, l;
uint16_t eh_type, tcp_data_len;
struct lro_head *bucket;
+ int force_flush = 0;
/* We expect a contiguous header [eh, ip, tcp]. */
@@ -669,8 +670,15 @@
* Check TCP header constraints.
*/
/* Ensure no bits set besides ACK or PSH. */
- if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0)
- return (TCP_LRO_CANNOT);
+ if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0) {
+ if (th->th_flags & TH_SYN)
+ return (TCP_LRO_CANNOT);
+ /*
+ * Make sure that previously seen segements/ACKs are delivered
+ * before this segement, e.g. FIN.
+ */
+ force_flush = 1;
+ }
/* XXX-BZ We lose a ACK|PUSH flag concatenating multiple segments. */
/* XXX-BZ Ideally we'd flush on PUSH? */
@@ -686,8 +694,13 @@
ts_ptr = (uint32_t *)(th + 1);
if (l != 0 && (__predict_false(l != TCPOLEN_TSTAMP_APPA) ||
(*ts_ptr != ntohl(TCPOPT_NOP<<24|TCPOPT_NOP<<16|
- TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP))))
- return (TCP_LRO_CANNOT);
+ TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)))) {
+ /*
+ * Make sure that previously seen segements/ACKs are delivered
+ * before this segement.
+ */
+ force_flush = 1;
+ }
/* If the driver did not pass in the checksum, set it now. */
if (csum == 0x0000)
@@ -754,6 +767,13 @@
#endif
}
+ if (force_flush) {
+ /* Timestamps mismatch; this is a FIN, etc */
+ tcp_lro_active_remove(le);
+ tcp_lro_flush(lc, le);
+ return (TCP_LRO_CANNOT);
+ }
+
/* Flush now if appending will result in overflow. */
if (le->p_len > (lc->lro_length_lim - tcp_data_len)) {
tcp_lro_active_remove(le);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 2:17 AM (16 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28525171
Default Alt Text
D7415.id19031.diff (1 KB)
Attached To
Mode
D7415: tcp/lro: If timestamps mismatch or it's a FIN, force flush.
Attached
Detach File
Event Timeline
Log In to Comment