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
F95782511: D28656.diff
Sun, Sep 22, 2:48 PM
Unknown Object (File)
Fri, Sep 20, 7:43 AM
Unknown Object (File)
Tue, Sep 3, 6:33 AM
Unknown Object (File)
Thu, Aug 29, 12:28 PM
Unknown Object (File)
Aug 14 2024, 1:11 AM
Unknown Object (File)
Aug 14 2024, 1:11 AM
Unknown Object (File)
Aug 14 2024, 1:11 AM
Unknown Object (File)
Aug 14 2024, 12:59 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