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 Sat, Feb 13, 11:57 PM.

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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.