Page MenuHomeFreeBSD

Fix SEG.SEQ in SYN.ACK when handling SYN in SYN-SENT on socket with TCP_NOOPT enabled.
ClosedPublic

Authored by tuexen on Feb 13 2021, 11:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 15 2024, 11:50 PM
Unknown Object (File)
Dec 23 2023, 10:41 AM
Unknown Object (File)
Dec 10 2023, 9:44 PM
Unknown Object (File)
Oct 13 2023, 6:02 PM
Unknown Object (File)
Oct 12 2023, 4:48 PM
Unknown Object (File)
Oct 10 2023, 7:36 PM
Unknown Object (File)
Sep 13 2023, 5:14 AM
Unknown Object (File)
Sep 3 2023, 11:32 PM
Subscribers

Details

Summary

This patch ensures that the SEG.SEQ is the ISS when sending a SYN-ACK segment in the SYN-SENT state in response to a received SYN segment on a socket with TCP_NOOPT enabled.

Test Plan

Run the following packetdrill script':

 0.00 `sysctl -w net.inet.tcp.hostcache.purgenow=1`
+0.00 `sysctl -w net.inet.tcp.syncookies_only=0`
+0.00 `sysctl -w net.inet.tcp.syncookies=1`
+0.00 `sysctl -w net.inet.tcp.rfc1323=0`
+0.00 `sysctl -w net.inet.tcp.sack.enable=0`
+0.00 `sysctl -w net.inet.tcp.ecn.enable=2`

+0.00 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0.00 fcntl(3, F_GETFL) = 0x02 (flags O_RDWR)
+0.00 fcntl(3, F_SETFL, O_RDWR | O_NONBLOCK) = 0
+0.00 setsockopt(3, IPPROTO_TCP, TCP_NOOPT, [1], 4) = 0
+0.00 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
+0.00 > S    0:0(0)       win 65535
+0.05 < S    0:0(0)       win 65535
+0.00 > S.   0:0(0) ack 1 win 65535
+0.00 <  .   1:1(0) ack 1 win 65535
+0.00 %{ assert tcpi_state == TCPI_ESTABLISHED }%
+0.00 %{ assert tcpi_options == 0}%

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable