]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
extensions: libxt_socket: update man pages and tests for --restore-skmark
authorHarout Hedeshian <harouth@codeaurora.org>
Mon, 13 Jul 2015 16:01:30 +0000 (10:01 -0600)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 15 Jul 2015 16:40:41 +0000 (18:40 +0200)
Update the man pages for libxt_socket with a description and example
usage of the --restore-skmark option.

Also added tests for libxt_socket with various combinations of
--restore-skmark and the existing options.

Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
extensions/libxt_socket.man
extensions/libxt_socket.t

index 2ef32cecfc0213f6218d5812beb55416645cfdb3..f809df697cb19353e79cad09384cc2959a59970f 100644 (file)
@@ -20,3 +20,17 @@ option instead.
 Example (assuming packets with mark 1 are delivered locally):
 .IP
 \-t mangle \-A PREROUTING \-m socket \-\-transparent \-j MARK \-\-set\-mark 1
+.TP
+\fB\-\-restore\-skmark\fP
+Set the packet mark to the matching socket's mark. Can be combined with the
+\fB\-\-transparent\fP and \fB\-\-nowildcard\fP options to restrict the sockets
+to be matched when restoring the packet mark.
+.PP
+Example: An application opens 2 transparent (\fBIP_TRANSPARENT\fP) sockets and
+sets a mark on them with \fBSO_MARK\fP socket option. We can filter matching packets:
+.IP
+\-t mangle \-I PREROUTING \-m socket \-\-transparent \-\-restore-skmark \-j action
+.IP
+\-t mangle \-A action \-m mark \-\-mark 10 \-j action2
+.IP
+\-t mangle \-A action \-m mark \-\-mark 11 \-j action3
index 8c0036e20bbfbb01bf532868646424748abe62c1..fe4eb3e4ba2d2331e5f50fe949eca77464aba8dd 100644 (file)
@@ -2,3 +2,7 @@
 *mangle
 -m socket;=;OK
 -m socket --transparent --nowildcard;=;OK
+-m socket --transparent --nowildcard --restore-skmark;=;OK
+-m socket --transparent --restore-skmark;=;OK
+-m socket --nowildcard --restore-skmark;=;OK
+-m socket --restore-skmark;=;OK