Page MenuHomeFreeBSD

bblog: inherit TCP_LOG option
ClosedPublic

Authored by tuexen on Feb 8 2023, 11:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 30 2023, 4:04 PM
Unknown Object (File)
Dec 23 2023, 12:53 AM
Unknown Object (File)
Dec 22 2023, 11:56 PM
Unknown Object (File)
Dec 20 2023, 5:20 AM
Unknown Object (File)
Dec 10 2023, 6:00 PM
Unknown Object (File)
Nov 7 2023, 9:42 AM
Unknown Object (File)
Oct 10 2023, 5:53 PM
Unknown Object (File)
Oct 1 2023, 9:13 AM

Details

Summary

When the TCP_LOG option is used to enable logging on a listening socket, inherit this if the listener is not auto selected and does not have a log id set.

Test Plan

Run the following packetdrill script:

 0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0.000 setsockopt(3, IPPROTO_TCP, TCP_LOG, [TCP_LOG_STATE_CONTINUAL], 4) = 0
+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 32767 <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 32767
+0.000 accept(3, ..., ...) = 4
+0.000 getsockopt(3, IPPROTO_TCP, TCP_LOG, [TCP_LOG_STATE_CONTINUAL], [4]) = 0
+0.000 getsockopt(4, IPPROTO_TCP, TCP_LOG, [TCP_LOG_STATE_CONTINUAL], [4]) = 0
+0.000 close(3) = 0
+0.000 close(4) = 0
+0.000 > F. 1:1(0) ack 1 win 65535
+0.050 < F. 1:1(0) ack 2 win 32767
+0.000 >  . 2:2(0) ack 2 win 65535

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cc requested changes to this revision.Feb 8 2023, 4:28 PM
cc added a subscriber: cc.

Please revise the SUMMARY part: "if the listener is not auto selected or has a log id set." => "if the listener is not auto selected or does not have a log id set."

This revision now requires changes to proceed.Feb 8 2023, 4:28 PM
sys/netinet/tcp_syncache.c
1030

Looks in default t_logstate is TCP_LOG_STATE_OFF, so check this first can save further checks in default.

In D38436#874676, @guest-ccui wrote:

Please revise the SUMMARY part: "if the listener is not auto selected or has a log id set." => "if the listener is not auto selected or does not have a log id set."

Change to: and does not have

This revision is now accepted and ready to land.Feb 9 2023, 4:03 PM

Update to latest version of the main tree.

This revision now requires review to proceed.Apr 20 2023, 10:46 PM
This revision was not accepted when it landed; it landed in state Needs Review.May 6 2023, 9:24 AM
This revision was automatically updated to reflect the committed changes.