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)
Sat, Dec 7, 3:24 PM
Unknown Object (File)
Wed, Dec 4, 6:38 PM
Unknown Object (File)
Nov 22 2024, 9:47 PM
Unknown Object (File)
Nov 13 2024, 7:49 PM
Unknown Object (File)
Nov 11 2024, 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
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