Page MenuHomeFreeBSD

tcp md5: improve handling of tcps_sig_err_sigopt counter
ClosedPublic

Authored by tuexen on Fri, Aug 28, 3:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Sep 23, 12:18 AM
Unknown Object (File)
Sat, Sep 19, 1:04 AM
Unknown Object (File)
Thu, Sep 17, 1:42 PM
Unknown Object (File)
Mon, Sep 14, 1:50 AM
Unknown Object (File)
Sat, Sep 12, 8:14 PM
Unknown Object (File)
Sat, Sep 12, 5:29 AM
Unknown Object (File)
Fri, Sep 11, 8:12 AM
Unknown Object (File)
Fri, Sep 11, 5:26 AM

Details

Summary

For non listening TCP endpoints, increment the tcps_sig_err_sigopt counter when TCP MD5 is not enabled in the TCP connection, but a segment containing a TCP MD5 option is received.
Also increment the counter when using the RACK or BBR stack.

Reported by: Hannes Elfert

Test Plan

Run the packetdrill script

--ip_version=ipv4
--tolerance_usecs=50000
--tcp_md5_secret=secret

// Ensure that all relevant sysctl variables have their default variables.
 0.000 `sysctl -w net.inet.tcp.rfc1323=1`
+0.000 `sysctl -w net.inet.tcp.sack.enable=1`
+0.000 `sysctl -w kern.ipc.maxsockbuf=2097152`
// Flush host cache.
+0.000 `sysctl -w net.inet.tcp.hostcache.purgenow=1`
// Create a TCP endpoint in the ESTABLISHED state.
+0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0.000 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+0.000 connect(3, ..., ...) = -1 EINPROGRESS (Operation in progress)
+0.000 > S    0:0(0)             win 65535 <mss 1460,nop,wscale 6,sackOK,TS val 1000 ecr 0>
+0.050 < S.   0:0(0)     ack   1 win 65535 <mss 1460,sackOK,md5 valid>
+0.000 >  .   1:1(0)     ack   1 win 65535
+0.100 < P.   1:101(100) ack   1 win 65535 <nop,nop,md5 valid>
+0.000 recv(3, ..., 1000, 0) = 100
+0.040 >  .   1:1(0)     ack 101 win 65535
+0.100 < F. 101:101(0)   ack   1 win 65535 <nop,nop,md5 valid>
+0.000 >  .   1:1(0)     ack 102 win 65535
+0.000 recv(3, ..., 1000, 0) = 0
+0.000 close(3) = 0
+0.000 > F.   1:1(0)     ack 102 win 65535
+0.050 <  . 102:102(0)   ack   2 win 65535 <nop,nop,md5 valid>

and check using netstat -sptcp that the tcps_sig_err_sigopt counter was incremented by 4.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped