Skip to contentSkip to conversation

Man pages review

PATCH In review Phil Sutter 1 participant 17 messages Aug 2, 2023 – Aug 4, 2023 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

v2 cover Man pages review

Thanks to the manpage-l10n project, we received several tickets listing a number of corrections and improvements to the different iptables man pages. This series implements what I considered valid and worth keeping.

Changes since v1:
- Adjusted patches 6, 7 and 14 as per Jan's feedback.
- Folded the two trivial "missing space after comma" patches into one, they even fixed the same commit.

Phil Sutter (15):
man: iptables.8: Extend exit code description
man: iptables.8: Trivial spelling fixes
man: iptables.8: Fix intra page reference
man: iptables.8: Clarify --goto description
man: Use HTTPS for links to netfilter.org
man: iptables.8: Trivial font fixes
man: iptables-restore.8: Fix --modprobe description
man: iptables-restore.8: Consistently document -w option
man: iptables-restore.8: Drop -W option from synopsis
man: iptables-restore.8: Put 'file' in italics in synopsis
man: iptables-restore.8: Start paragraphs in upper-case
man: Trivial: Missing space after comma
man: iptables-save.8: Clarify 'available tables'
man: iptables-save.8: Fix --modprobe description
man: iptables-save.8: Start paragraphs in upper-case

 extensions/libxt_nfacct.man    |  2 +-
 iptables/iptables-restore.8.in | 25 ++++++++++++------------
 iptables/iptables-save.8.in    | 18 ++++++++++-------
 iptables/iptables.8.in         | 35 ++++++++++++++++++----------------
 4 files changed, 44 insertions(+), 36 deletions(-)
Signature · 1 line
2.40.0
author reviewer
#1 lore raw

PATCH v2 1/15 man: iptables.8: Extend exit code description

Codes 3 and 4 were missing.

---
 iptables/iptables.8.in | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
iptables/iptables.8.in +6 -3
index f81c632f2be86..2dd1406615106 100644
@@ -410,9 +410,12 @@ the default setting.
 iptables can use extended packet matching and target modules.
 A list of these is available in the \fBiptables\-extensions\fP(8) manpage.
 .SH DIAGNOSTICS
-Various error messages are printed to standard error.  The exit code
-is 0 for correct functioning.  Errors which appear to be caused by
-invalid or abused command line parameters cause an exit code of 2, and
+Various error messages are printed to standard error.  The exit code is 0 for
+correct functioning.  Errors which appear to be caused by invalid or abused
+command line parameters cause an exit code of 2. Errors which indicate an
+incompatibility between kernel and user space cause an exit code of 3. Errors
+which indicate a resource problem, such as a busy lock, failing memory
+allocation or error messages from kernel cause an exit code of 4. Finally,
 other errors cause an exit code of 1.
 .SH BUGS
 Bugs?  What's this? ;-)
Signature · 1 line
2.40.0
author reviewer
#2 lore raw

PATCH v2 2/15 man: iptables.8: Trivial spelling fixes

In reply to Phil Sutter

- Missing "and" as well as full stop
- Missing comma in enumeration
- Duplicate "previous"
- Confusions are avoided rather than simplified
- Missing space after comma

---
 iptables/iptables.8.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
iptables/iptables.8.in +5 -5
index 2dd1406615106..6486588e34744 100644
@@ -125,8 +125,8 @@ This table is used mainly for configuring exemptions from connection
 tracking in combination with the NOTRACK target.  It registers at the netfilter
 hooks with higher priority and is thus called before ip_conntrack, or any other
 IP tables.  It provides the following built-in chains: \fBPREROUTING\fP
-(for packets arriving via any network interface) \fBOUTPUT\fP
-(for packets generated by local processes)
+(for packets arriving via any network interface) and \fBOUTPUT\fP
+(for packets generated by local processes).
 .TP
 \fBsecurity\fP:
 This table is used for Mandatory Access Control (MAC) networking rules, such
@@ -258,7 +258,7 @@ This option has no effect in ip6tables and ip6tables-restore.
 [\fB!\fP] \fB\-p\fP, \fB\-\-protocol\fP \fIprotocol\fP
 The protocol of the rule or of the packet to check.
 The specified protocol can be one of \fBtcp\fP, \fBudp\fP, \fBudplite\fP,
-\fBicmp\fP, \fBicmpv6\fP,\fBesp\fP, \fBah\fP, \fBsctp\fP, \fBmh\fP or the special keyword "\fBall\fP",
+\fBicmp\fP, \fBicmpv6\fP, \fBesp\fP, \fBah\fP, \fBsctp\fP, \fBmh\fP or the special keyword "\fBall\fP",
 or it can be a numeric value, representing one of these protocols or a
 different one.  A protocol name from /etc/protocols is also allowed.
 A "!" argument before the protocol inverts the
@@ -386,7 +386,7 @@ network names, or services (whenever applicable).
 \fB\-x\fP, \fB\-\-exact\fP
 Expand numbers.
 Display the exact value of the packet and byte counters,
-instead of only the rounded number in K's (multiples of 1000)
+instead of only the rounded number in K's (multiples of 1000),
 M's (multiples of 1000K) or G's (multiples of 1000M).  This option is
 only relevant for the \fB\-L\fP command.
 .TP
@@ -441,7 +441,7 @@ entering the \fBFORWARD\fP chain.
 .PP
 The various forms of NAT have been separated out; \fBiptables\fP
 is a pure packet filter when using the default `filter' table, with
-optional extension modules.  This should simplify much of the previous
+optional extension modules.  This should avoid much of the
 confusion over the combination of IP masquerading and packet filtering
 seen previously.  So the following options are handled differently:
 .nf
Signature · 1 line
2.40.0
author reviewer
#3 lore raw

PATCH v2 3/15 man: iptables.8: Fix intra page reference

In reply to Phil Sutter

When sections MATCH EXTENSIONS and TARGET EXTENSIONS were combined, the reference could have been updated to specify the exact title.

Fixes 4496801821c01 ("doc: deduplicate extension descriptions into a new manpage")
---
 iptables/iptables.8.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
iptables/iptables.8.in +2 -2
index 6486588e34744..85af18008daab 100644
@@ -307,8 +307,8 @@ false, evaluation will stop.
 This specifies the target of the rule; i.e., what to do if the packet
 matches it.  The target can be a user-defined chain (other than the
 one this rule is in), one of the special builtin targets which decide
-the fate of the packet immediately, or an extension (see \fBEXTENSIONS\fP
-below).  If this
+the fate of the packet immediately, or an extension (see \fBMATCH AND TARGET
+EXTENSIONS\fP below).  If this
 option is omitted in a rule (and \fB\-g\fP
 is not used), then matching the rule will have no
 effect on the packet's fate, but the counters on the rule will be
Signature · 1 line
2.40.0
author reviewer
#4 lore raw

PATCH v2 4/15 man: iptables.8: Clarify --goto description

In reply to Phil Sutter

Text speaks about behaviour of RETURN target when used in chains redirected to using --goto instead of --jump, not the difference between --jump option and "return".

Fixes 17fc163babc34 ("add 'goto' support (Henrik Nordstrom <[email protected]>)")
---
 iptables/iptables.8.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
iptables/iptables.8.in +1 -1
index 85af18008daab..c83275b294872 100644
@@ -316,7 +316,7 @@ incremented.
 .TP
 \fB\-g\fP, \fB\-\-goto\fP \fIchain\fP
 This specifies that the processing should continue in a user
-specified chain. Unlike the \-\-jump option return will not continue
+specified chain. Unlike with the \-\-jump option, \fBRETURN\fP will not continue
 processing in this chain but instead in the chain that called us via
 \-\-jump.
 .TP
Signature · 1 line
2.40.0
author reviewer
#5 lore raw

PATCH v2 5/15 man: Use HTTPS for links to netfilter.org

In reply to Phil Sutter

The browser is redirected there anyway, but who cares about such minor details nowadays.

---
 extensions/libxt_nfacct.man | 2 +-
 iptables/iptables.8.in      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
extensions/libxt_nfacct.man +1 -1
index b755f9770451c..a818fedd6b1ac 100644
@@ -26,5 +26,5 @@ nfacct get http\-traffic
 .PP
 You can obtain
 .B nfacct(8)
-from http://www.netfilter.org or, alternatively, from the git.netfilter.org
+from https://www.netfilter.org or, alternatively, from the git.netfilter.org
 repository.
iptables/iptables.8.in +2 -2
index c83275b294872..71a6251d6b00c 100644
@@ -419,7 +419,7 @@ allocation or error messages from kernel cause an exit code of 4. Finally,
 other errors cause an exit code of 1.
 .SH BUGS
 Bugs?  What's this? ;-)
-Well, you might want to have a look at http://bugzilla.netfilter.org/
+Well, you might want to have a look at https://bugzilla.netfilter.org/
 \fBiptables\fP will exit immediately with an error code of 111 if it finds
 that it was called as a setuid-to-root program.
 iptables cannot be used safely in this manner because it trusts
@@ -463,7 +463,7 @@ not in the standard distribution,
 and the netfilter-hacking-HOWTO details the netfilter internals.
 .br
 See
-.BR "http://www.netfilter.org/" .
+.BR "https://www.netfilter.org/" .
 .SH AUTHORS
 Rusty Russell originally wrote iptables, in early consultation with Michael
 Neuling.
Signature · 1 line
2.40.0
author reviewer
#6 lore raw

PATCH v2 6/15 man: iptables.8: Trivial font fixes

In reply to Phil Sutter

No content changes intended, just type commands in bold and the single path reference in italics.

---
Changes since v1:
- Put only commands in bold font, not program names
- Add missing dash-escaping if done so

---
 iptables/iptables.8.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
iptables/iptables.8.in +3 -3
index 71a6251d6b00c..ecaa5553942df 100644
@@ -244,13 +244,13 @@ add, delete, insert, replace and append commands).
 \fB\-4\fP, \fB\-\-ipv4\fP
 This option has no effect in iptables and iptables-restore.
 If a rule using the \fB\-4\fP option is inserted with (and only with)
-ip6tables-restore, it will be silently ignored. Any other uses will throw an
+\fBip6tables\-restore\fP, it will be silently ignored. Any other uses will throw an
 error. This option allows IPv4 and IPv6 rules in a single rule file
 for use with both iptables-restore and ip6tables-restore.
 .TP
 \fB\-6\fP, \fB\-\-ipv6\fP
 If a rule using the \fB\-6\fP option is inserted with (and only with)
-iptables-restore, it will be silently ignored. Any other uses will throw an
+\fBiptables\-restore\fP, it will be silently ignored. Any other uses will throw an
 error. This option allows IPv4 and IPv6 rules in a single rule file
 for use with both iptables-restore and ip6tables-restore.
 This option has no effect in ip6tables and ip6tables-restore.
@@ -260,7 +260,7 @@ The protocol of the rule or of the packet to check.
 The specified protocol can be one of \fBtcp\fP, \fBudp\fP, \fBudplite\fP,
 \fBicmp\fP, \fBicmpv6\fP, \fBesp\fP, \fBah\fP, \fBsctp\fP, \fBmh\fP or the special keyword "\fBall\fP",
 or it can be a numeric value, representing one of these protocols or a
-different one.  A protocol name from /etc/protocols is also allowed.
+different one.  A protocol name from \fI/etc/protocols\fP is also allowed.
 A "!" argument before the protocol inverts the
 test.  The number zero is equivalent to \fBall\fP. "\fBall\fP"
 will match with all protocols and is taken as default when this
Signature · 1 line
2.40.0
author reviewer
#7 lore raw

PATCH v2 7/15 man: iptables-restore.8: Fix --modprobe description

In reply to Phil Sutter

- Consistently use 'modprobe' as option argument name
- Add a reference to modprobe man page
- Put the path in italics, and the command in bold

Fixes 8c46901ff5785 ("doc: document iptables-restore's -M option")

---
Changes since v1:
- Non-bold "modprobe" and iptables-restore program name

---
 iptables/iptables-restore.8.in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
iptables/iptables-restore.8.in +4 -3
index 20216842d8358..f95f00acd8d49 100644
@@ -67,9 +67,10 @@ the program will exit if the lock cannot be obtained.  This option will
 make the program wait (indefinitely or for optional \fIseconds\fP) until
 the exclusive lock can be obtained.
 .TP
-\fB\-M\fP, \fB\-\-modprobe\fP \fImodprobe_program\fP
-Specify the path to the modprobe program. By default, iptables-restore will
-inspect /proc/sys/kernel/modprobe to determine the executable's path.
+\fB\-M\fP, \fB\-\-modprobe\fP \fImodprobe\fP
+Specify the path to the modprobe(8) program. By default,
+iptables-restore will inspect \fI/proc/sys/kernel/modprobe\fP to
+determine the executable's path.
 .TP
 \fB\-T\fP, \fB\-\-table\fP \fIname\fP
 Restore only the named table even if the input stream contains other ones.
Signature · 1 line
2.40.0
author reviewer
#8 lore raw

PATCH v2 8/15 man: iptables-restore.8: Consistently document -w option

In reply to Phil Sutter

Use the same name for the option's argument.

Fixes 65801d02a482b ("iptables-restore.8: document -w/-W options")
---
 iptables/iptables-restore.8.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
iptables/iptables-restore.8.in +2 -2
index f95f00acd8d49..a63a344c0bd72 100644
@@ -23,11 +23,11 @@ iptables-restore \(em Restore IP Tables
 .P
 ip6tables-restore \(em Restore IPv6 Tables
 .SH SYNOPSIS
-\fBiptables\-restore\fP [\fB\-chntvV\fP] [\fB\-w\fP \fIsecs\fP]
+\fBiptables\-restore\fP [\fB\-chntvV\fP] [\fB\-w\fP \fIseconds\fP]
 [\fB\-W\fP \fIusecs\fP] [\fB\-M\fP \fImodprobe\fP] [\fB\-T\fP \fIname\fP]
 [\fBfile\fP]
 .P
-\fBip6tables\-restore\fP [\fB\-chntvV\fP] [\fB\-w\fP \fIsecs\fP]
+\fBip6tables\-restore\fP [\fB\-chntvV\fP] [\fB\-w\fP \fIseconds\fP]
 [\fB\-W\fP \fIusecs\fP] [\fB\-M\fP \fImodprobe\fP] [\fB\-T\fP \fIname\fP]
 [\fBfile\fP]
 .SH DESCRIPTION
Signature · 1 line
2.40.0
author reviewer
#9 lore raw

PATCH v2 9/15 man: iptables-restore.8: Drop -W option from synopsis

In reply to Phil Sutter

The description was dropped already, there is no benefit in still listing it.

Fixes 07e2107ef0cbc ("xshared: Implement xtables lock timeout using signals")
---
 iptables/iptables-restore.8.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
iptables/iptables-restore.8.in +2 -2
index a63a344c0bd72..bfd2fc355dd49 100644
@@ -24,11 +24,11 @@ iptables-restore \(em Restore IP Tables
 ip6tables-restore \(em Restore IPv6 Tables
 .SH SYNOPSIS
 \fBiptables\-restore\fP [\fB\-chntvV\fP] [\fB\-w\fP \fIseconds\fP]
-[\fB\-W\fP \fIusecs\fP] [\fB\-M\fP \fImodprobe\fP] [\fB\-T\fP \fIname\fP]
+[\fB\-M\fP \fImodprobe\fP] [\fB\-T\fP \fIname\fP]
 [\fBfile\fP]
 .P
 \fBip6tables\-restore\fP [\fB\-chntvV\fP] [\fB\-w\fP \fIseconds\fP]
-[\fB\-W\fP \fIusecs\fP] [\fB\-M\fP \fImodprobe\fP] [\fB\-T\fP \fIname\fP]
+[\fB\-M\fP \fImodprobe\fP] [\fB\-T\fP \fIname\fP]
 [\fBfile\fP]
 .SH DESCRIPTION
 .PP
Signature · 1 line
2.40.0
author reviewer
#10 lore raw

PATCH v2 10/15 man: iptables-restore.8: Put 'file' in italics in synopsis

In reply to Phil Sutter

The text has it this way already, be consistent.

Fixes 081d57839e91e ("iptables-restore.8: file to read from can be specified as argument")
---
 iptables/iptables-restore.8.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
iptables/iptables-restore.8.in +2 -2
index bfd2fc355dd49..ff8179091eeee 100644
@@ -25,11 +25,11 @@ ip6tables-restore \(em Restore IPv6 Tables
 .SH SYNOPSIS
 \fBiptables\-restore\fP [\fB\-chntvV\fP] [\fB\-w\fP \fIseconds\fP]
 [\fB\-M\fP \fImodprobe\fP] [\fB\-T\fP \fIname\fP]
-[\fBfile\fP]
+[\fIfile\fP]
 .P
 \fBip6tables\-restore\fP [\fB\-chntvV\fP] [\fB\-w\fP \fIseconds\fP]
 [\fB\-M\fP \fImodprobe\fP] [\fB\-T\fP \fIname\fP]
-[\fBfile\fP]
+[\fIfile\fP]
 .SH DESCRIPTION
 .PP
 .B iptables-restore
Signature · 1 line
2.40.0
author reviewer
#11 lore raw

PATCH v2 11/15 man: iptables-restore.8: Start paragraphs in upper-case

In reply to Phil Sutter

Also add a missing full stop in one spot.

Fixes 117341ada43dd ("Added iptbles-restore and iptables-save manpages")
---
 iptables/iptables-restore.8.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
iptables/iptables-restore.8.in +2 -2
index ff8179091eeee..ce4520e626772 100644
@@ -40,13 +40,13 @@ are used to restore IP and IPv6 Tables from data specified on STDIN or in
 specify \fIfile\fP as an argument.
 .TP
 \fB\-c\fR, \fB\-\-counters\fR
-restore the values of all packet and byte counters
+Restore the values of all packet and byte counters.
 .TP
 \fB\-h\fP, \fB\-\-help\fP
 Print a short option summary.
 .TP
 \fB\-n\fR, \fB\-\-noflush\fR
-don't flush the previous contents of the table. If not specified,
+Don't flush the previous contents of the table. If not specified,
 both commands flush (delete) all previous contents of the respective table.
 .TP
 \fB\-t\fP, \fB\-\-test\fP
Signature · 1 line
2.40.0
author reviewer
#12 lore raw

PATCH v2 12/15 man: Trivial: Missing space after comma

In reply to Phil Sutter
Fixes 6a79d78986c02 ("iptables: mention iptables-apply(8) in manpages")
---
 iptables/iptables-restore.8.in | 2 +-
 iptables/iptables-save.8.in    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
iptables/iptables-restore.8.in +1 -1
index ce4520e626772..aa816f794d6f3 100644
@@ -82,7 +82,7 @@ from Rusty Russell.
 .br
 Andras Kis-Szabo <[email protected]> contributed ip6tables-restore.
 .SH SEE ALSO
-\fBiptables\-apply\fP(8),\fBiptables\-save\fP(8), \fBiptables\fP(8)
+\fBiptables\-apply\fP(8), \fBiptables\-save\fP(8), \fBiptables\fP(8)
 .PP
 The iptables-HOWTO, which details more iptables usage, the NAT-HOWTO,
 which details NAT, and the netfilter-hacking-HOWTO which details the
iptables/iptables-save.8.in +1 -1
index 7683fd3780f72..253907719acee 100644
@@ -62,7 +62,7 @@ Rusty Russell <[email protected]>
 .br
 Andras Kis-Szabo <[email protected]> contributed ip6tables-save.
 .SH SEE ALSO
-\fBiptables\-apply\fP(8),\fBiptables\-restore\fP(8), \fBiptables\fP(8)
+\fBiptables\-apply\fP(8), \fBiptables\-restore\fP(8), \fBiptables\fP(8)
 .PP
 The iptables-HOWTO, which details more iptables usage, the NAT-HOWTO,
 which details NAT, and the netfilter-hacking-HOWTO which details the
Signature · 1 line
2.40.0
author reviewer
#13 lore raw

PATCH v2 13/15 man: iptables-save.8: Clarify 'available tables'

In reply to Phil Sutter

This appears to be confusing. Since a missing table is also not flushed ("restored") when feeding the dump into iptables-restore, such a restore call may be considered incomplete.

---
 iptables/iptables-save.8.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
iptables/iptables-save.8.in +4 -1
index 253907719acee..7f84907352238 100644
@@ -52,7 +52,10 @@ restrict output to only one table. If the kernel is configured with automatic
 module loading, an attempt will be made to load the appropriate module for
 that table if it is not already there.
 .br
-If not specified, output includes all available tables.
+If not specified, output includes all available tables. No module loading takes
+place, so in order to include a specific table in the output, the respective
+module (something like \fBiptable_mangle\fP or \fBip6table_raw\fP) must be
+loaded first.
 .SH BUGS
 None known as of iptables-1.2.1 release
 .SH AUTHORS
Signature · 1 line
2.40.0
author reviewer
#14 lore raw

PATCH v2 14/15 man: iptables-save.8: Fix --modprobe description

In reply to Phil Sutter

- Consistently use 'modprobe' as option argument name
- Add a reference to modprobe man page
- Put the path in italics and the command in bold

Fixes fbb5639c02218 ("iptables-save: module loading corrections")

---
Changes since v1:
- Non-bold "modprobe" and iptables-restore program name

---
 iptables/iptables-save.8.in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
iptables/iptables-save.8.in +4 -3
index 7f84907352238..118dddcdf62d5 100644
@@ -36,9 +36,10 @@ and
 are used to dump the contents of IP or IPv6 Table in easily parseable format
 either to STDOUT or to a specified file.
 .TP
-\fB\-M\fR, \fB\-\-modprobe\fR \fImodprobe_program\fP
-Specify the path to the modprobe program. By default, iptables-save will
-inspect /proc/sys/kernel/modprobe to determine the executable's path.
+\fB\-M\fR, \fB\-\-modprobe\fR \fImodprobe\fP
+Specify the path to the modprobe(8) program. By default,
+iptables-save will inspect \fI/proc/sys/kernel/modprobe\fP to determine
+the executable's path.
 .TP
 \fB\-f\fR, \fB\-\-file\fR \fIfilename\fP
 Specify a filename to log the output to. If not specified, iptables-save
Signature · 1 line
2.40.0
author reviewer
#15 lore raw

PATCH v2 15/15 man: iptables-save.8: Start paragraphs in upper-case

In reply to Phil Sutter

Also add a missing full stop.

Fixes 117341ada43dd ("Added iptbles-restore and iptables-save manpages")
---
 iptables/iptables-save.8.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
iptables/iptables-save.8.in +2 -2
index 118dddcdf62d5..65c1f28ccc3c7 100644
@@ -46,10 +46,10 @@ Specify a filename to log the output to. If not specified, iptables-save
 will log to STDOUT.
 .TP
 \fB\-c\fR, \fB\-\-counters\fR
-include the current values of all packet and byte counters in the output
+Include the current values of all packet and byte counters in the output.
 .TP
 \fB\-t\fR, \fB\-\-table\fR \fItablename\fP
-restrict output to only one table. If the kernel is configured with automatic
+Restrict output to only one table. If the kernel is configured with automatic
 module loading, an attempt will be made to load the appropriate module for
 that table if it is not already there.
 .br
Signature · 1 line
2.40.0
author reviewer
#16 lore raw
In reply to Phil Sutter
Quoted 7 lines · Phil Sutter

Thanks to the manpage-l10n project, we received several tickets listing a number of corrections and improvements to the different iptables man pages. This series implements what I considered valid and worth keeping.

Series applied.