Page MenuHomeFreeBSD

tcp md5: improve handling of tcps_sig_err_sigopt counter
Needs ReviewPublic

Authored by tuexen on Fri, Aug 28, 3:48 PM.

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
--tcp_md5_secret=secret

// Ensure that all relevant sysctl variables have their default variables.
 0.000 `sysctl -w net.inet.tcp.sack.enable=1`
// 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 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
+0.000 bind(3, ..., ...) = 0
+0.000 listen(3, 1) = 0
+0.000 < S    0:0(0)             win 65535 <mss 1460,sackOK,eol,eol>
+0.000 > S.   0:0(0)     ack   1 win 65535 <mss 1460,sackOK,eol,eol>
+0.050 <  .   1:1(0)     ack   1 win 65535
+0.000 accept(3, ..., ...) = 4
+0.000 close(3) = 0
+0.100 < P.   1:101(100) ack   1 win 65535 <nop,nop,md5 valid>
+0.000 recv(4, ..., 1000, 0) = 100
+0.040 >  .   1:1(0)     ack 101 win 65535
+0.100 < F. 101:101(0)   ack   1 win 65535
+0.000 >  .   1:1(0)     ack 102 win 65535
+0.000 recv(4, ..., 1000, 0) = 0
+0.000 close(4) = 0
+0.000 > F.   1:1(0)     ack 102 win 65535
+0.050 <  . 102:102(0)   ack   2 win 65535

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped