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)
Fri, Nov 8, 12:59 AM
Unknown Object (File)
Wed, Nov 6, 5:26 PM
Unknown Object (File)
Wed, Oct 16, 9:44 AM
Unknown Object (File)
Wed, Oct 16, 9:23 AM
Unknown Object (File)
Oct 15 2024, 6:03 PM
Unknown Object (File)
Oct 14 2024, 6:28 PM
Unknown Object (File)
Oct 14 2024, 10:57 AM
Unknown Object (File)
Oct 13 2024, 4:54 PM

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 Skipped
Unit
Tests Skipped

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
1023

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.