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
F102413759: D28656.diff
Mon, Nov 11, 10:54 PM
Unknown Object (File)
Oct 6 2024, 2:07 AM
Unknown Object (File)
Oct 2 2024, 11:58 PM
Unknown Object (File)
Oct 1 2024, 9:24 AM
Unknown Object (File)
Sep 27 2024, 5:27 PM
Unknown Object (File)
Sep 26 2024, 8:56 PM
Unknown Object (File)
Sep 26 2024, 6:18 PM
Unknown Object (File)
Sep 24 2024, 4:10 AM
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 Skipped
Unit
Tests Skipped