Thread (4 messages) 4 messages, 2 authors, 2025-10-28

Re: [PATCH] man/man7/tcp.7: Add TCP_SAVE_SYN and TCP_SAVED_SYN

From: Alejandro Colomar <alx@kernel.org>
Date: 2025-10-15 21:25:36

Hi,

On Wed, Oct 08, 2025 at 12:03:52AM +0300, ValdikSS wrote:
---
Would you mind signing the patch?  Also, it would be helpful to describe
how you obtained the information, and also CC Eric Dumazet in your
patch (or any other person that might be involved in the feature).

See the contributing guidelines:

	$ cat CONTRIBUTING.d/patches/description 
	Name
		patches/description - instructions for writing a patch description

	Description
		The descrpiption of a patch is commonly known as commit message.
		it should describe the patch, including any details that may be
		of importance for its review.  It is formed by the subject, a
		blank line, the body, a blank line, and the trailer.

	    Subject
		See <CONTRIBUTING.d/patches/subject>.

	    Body
		Describe how you obtained the information in your patch.  For
		example, was it:

		-  by reading (or writing) the relevant kernel or (g)libc source
		   code?  Please provide a pointer to the relevant code.

		-  from a commit message in the kernel or (g)libc source code
		   repository?  Please provide a commit ID.

		-  by writing a test program?  Send it with the patch, but
		   please make sure it's as simple as possible, and provide
		   instructions on how to use it and/or a demo run.

		-  from a standards document?  Please name the standard, and
		   quote the relevant text.

		-  from other documentation?  Please provide a pointer to that
		   documentation.

		-  from a mailing list or online forum?  Please provide a URL
		   if possible.

		Where relevant, cite commit hashes for relevant kernel or glibc
		changes:

			linux.git f4b89d8ce5a8 ("landlock: Various documentation improvements")

	    Style guide
		URIs should always be enclosed in <>.

		The correct inter-sentence space amount is two.  See some
		history about this:
		<https://web.archive.org/web/20171217060354/http://www.heracliteanriver.com/?p=324>

	    Trailer
		Sign your patch with "Signed-off-by:".  Read about the
		"Developer's Certificate of Origin" at
		<https://www.kernel.org/doc/Documentation/process/submitting-patches.rst>.
		When appropriate, other tags documented in that file, such as
		"Reported-by:", "Reviewed-by:", "Acked-by:", and "Suggested-by:"
		can be added to the patch.  We use "Co-authored-by:" instead of
		"Co-developed-by:".  Example:

			Signed-off-by: Alejandro Colomar [off-list ref]
quoted hunk ↗ jump to hunk
 man/man7/tcp.7 | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/man/man7/tcp.7 b/man/man7/tcp.7
index a5fa4baa6..cb640f340 100644
--- a/man/man7/tcp.7
+++ b/man/man7/tcp.7
@@ -72,10 +72,6 @@
 .\"	   commit 6e9250f59ef9efb932c84850cd221f22c2a03c4a
 .\"	   Author: Eric Dumazet <edumazet@google.com>
 .\"
-.\"	TCP_SAVE_SYN, TCP_SAVED_SYN (4.2)
-.\"	    commit cd8ae85299d54155702a56811b2e035e63064d3d
-.\"	    Author: Eric Dumazet <edumazet@google.com>
-.\"
 .TH tcp 7 (date) "Linux man-pages (unreleased)"
 .SH NAME
 tcp \- TCP protocol
@@ -1202,6 +1198,22 @@ aborting the attempt to connect.
 It cannot exceed 255.
 This option should not be used in code intended to be portable.
 .TP
+.BR TCP_SAVE_SYN " (since Linux 4.3)"
+Saves incoming SYN packet contents of the listening socket until
+it is read with
+.B TCP_SAVED_SYN
+once. Could be set before or after the
Please use semantic newlines.

See man-pages(7):

$ MANWIDTH=72 man man-pages| sed -n '/Use semantic newlines/,/^$/p'
   Use semantic newlines
     In the source of a manual page, new sentences should be started on
     new lines, long sentences should be split  into  lines  at  clause
     breaks  (commas,  semicolons, colons, and so on), and long clauses
     should be split at phrase boundaries.  This convention,  sometimes
     known as "semantic newlines", makes it easier to see the effect of
     patches, which often operate at the level of individual sentences,
     clauses, or phrases.


Have a lovely night!
Alex
+.BR listen (2)
+call.
+.TP
+.BR TCP_SAVED_SYN " (since Linux 4.3)"
+Reads SYN packet contents saved by
+.BR TCP_SAVE_SYN .
+The saved SYN headers are freed after the first call.
+The data returned in
+.BR TCP_SAVED_SYN
+are network (IPv4/IPv6) and TCP headers.
+.TP
 .BR TCP_USER_TIMEOUT " (since Linux 2.6.37)"
 .\"	    commit dca43c75e7e545694a9dd6288553f55c53e2a3a3
 .\"	    Author: Jerry Chu [off-list ref]
-- 
2.51.0
-- 
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help