Page MenuHomeFreeBSD

bblog: inherit TCP_LOG option
ClosedPublic

Authored by tuexen on Feb 8 2023, 11:39 AM.
Tags
None
Referenced Files
F103337697: D38436.diff
Sat, Nov 23, 6:06 PM
F103321590: D38436.diff
Sat, Nov 23, 1:00 PM
F103305106: D38436.id116780.diff
Sat, Nov 23, 7:59 AM
Unknown Object (File)
Fri, Nov 22, 10:39 AM
Unknown Object (File)
Tue, Nov 19, 6:23 PM
Unknown Object (File)
Tue, Nov 19, 12:33 AM
Unknown Object (File)
Fri, Nov 15, 10:18 AM
Unknown Object (File)
Fri, Nov 15, 9:34 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.