From 3515fce9cf61bda98b1236633a87e7b0e84bac64 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Thu, 19 Jun 2008 13:45:36 +0200 Subject: release.sh: fix changelog filename Add missing .txt extension. Signed-off-by: Patrick McHardy --- release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.sh b/release.sh index e27c1217..5635e4c0 100644 --- a/release.sh +++ b/release.sh @@ -9,7 +9,7 @@ IPTDIR="$TMPDIR/iptables-$VERSION" PATCH=patch-iptables-$PREV_VERSION-$VERSION.bz2 TARBALL=iptables-$VERSION.tar.bz2 -CHANGELOG=changes-iptables-$PREV_VERSION-$VERSION +CHANGELOG=changes-iptables-$PREV_VERSION-$VERSION.txt mkdir -p "$TMPDIR" git shortlog v$PREV_VERSION..v$VERSION > "$TMPDIR/$CHANGELOG" -- cgit v1.2.3 From eaf831efecf936cab9a30f67284de7def4325545 Mon Sep 17 00:00:00 2001 From: Thomas Jacob Date: Mon, 23 Jun 2008 11:35:29 +0200 Subject: ip6tables: add --goto support Signed-off-by: Patrick McHardy --- ip6tables.8.in | 10 +++++++++- ip6tables.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/ip6tables.8.in b/ip6tables.8.in index 45b14dca..f5d33db1 100644 --- a/ip6tables.8.in +++ b/ip6tables.8.in @@ -301,10 +301,18 @@ one this rule is in), one of the special builtin targets which decide the fate of the packet immediately, or an extension (see .B EXTENSIONS below). If this -option is omitted in a rule, then matching the rule will have no +option is omitted in a rule (and +.B -g +is not used), then matching the rule will have no effect on the packet's fate, but the counters on the rule will be incremented. .TP +.BI "-g, --goto " "chain" +This specifies that the processing should continue in a user +specified chain. Unlike the --jump option return will not continue +processing in this chain but instead in the chain that called us via +--jump. +.TP .BR "-i, --in-interface " "[!] \fIname\fP" Name of an interface via which a packet is going to be received (only for packets entering the diff --git a/ip6tables.c b/ip6tables.c index e1461146..2b053924 100644 --- a/ip6tables.c +++ b/ip6tables.c @@ -132,6 +132,7 @@ static struct option original_opts[] = { {.name = "line-numbers", .has_arg = 0, .val = '0'}, {.name = "modprobe", .has_arg = 1, .val = 'M'}, {.name = "set-counters", .has_arg = 1, .val = 'c'}, + {.name = "goto", .has_arg = 1, .val = 'g'}, {NULL}, }; @@ -328,6 +329,10 @@ exit_printhelp(struct ip6tables_rule_match *matches) " network interface name ([+] for wildcard)\n" " --jump -j target\n" " target for rule (may load target extension)\n" +#ifdef IP6T_F_GOTO +" --goto -g chain\n" +" jump to chain with no return\n" +#endif " --match -m match\n" " extended match (may load extension)\n" " --numeric -n numeric output of addresses and ports\n" @@ -823,6 +828,11 @@ print_firewall(const struct ip6t_entry *fw, if (format & FMT_NOTABLE) fputs(" ", stdout); +#ifdef IP6T_F_GOTO + if(fw->ipv6.flags & IP6T_F_GOTO) + printf("[goto] "); +#endif + IP6T_MATCH_ITERATE(fw, print_match, &fw->ipv6, format & FMT_NUMERIC); if (target) { @@ -1259,7 +1269,11 @@ void print_rule(const struct ip6t_entry *e, /* Print target name */ target_name = ip6tc_get_target(e, h); if (target_name && (*target_name != '\0')) +#ifdef IP6T_F_GOTO + printf("-%c %s ", e->ipv6.flags & IP6T_F_GOTO ? 'g' : 'j', target_name); +#else printf("-j %s ", target_name); +#endif /* Print targinfo part */ t = ip6t_get_target((struct ip6t_entry *)e); @@ -1447,7 +1461,7 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle) opterr = 0; while ((c = getopt_long(argc, argv, - "-A:D:R:I:L::S::M:F::Z::N:X::E:P:Vh::o:p:s:d:j:i:bvnt:m:xc:", + "-A:D:R:I:L::S::M:F::Z::N:X::E:P:Vh::o:p:s:d:j:i:bvnt:m:xc:g:", opts, NULL)) != -1) { switch (c) { /* @@ -1638,6 +1652,15 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle) dhostnetworkmask = argv[optind-1]; break; +#ifdef IP6T_F_GOTO + case 'g': + set_option(&options, OPT_JUMP, &fw.ipv6.invflags, + invert); + fw.ipv6.flags |= IP6T_F_GOTO; + jumpto = parse_target(optarg); + break; +#endif + case 'j': set_option(&options, OPT_JUMP, &fw.ipv6.invflags, invert); @@ -1995,6 +2018,11 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle) * We cannot know if the plugin is corrupt, non * existant OR if the user just misspelled a * chain. */ +#ifdef IP6T_F_GOTO + if (fw.ipv6.flags & IP6T_F_GOTO) + exit_error(PARAMETER_PROBLEM, + "goto '%s' is not a chain\n", jumpto); +#endif find_target(jumpto, LOAD_MUST_SUCCEED); } else { e = generate_entry(&fw, matches, target->t); -- cgit v1.2.3 From ee3228af38ec98c60a3b6f72a9b1c75b5ef53641 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 23 Jun 2008 11:37:08 +0200 Subject: build: change equailty test for old bash Michael used GNU bash, version 1.14.7(1), which apparently does not seem to know about the double ("==") variant of equality tests. Reported-by: Michael Teicher Signed-off-by: Jan Engelhardt Signed-off-by: Patrick McHardy --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index ce26e28c..2d2f90fd 100644 --- a/configure.ac +++ b/configure.ac @@ -47,10 +47,10 @@ if test "$ac_cv_header_linux_dccp_h" != "yes"; then fi; AC_SUBST([blacklist_modules]) -AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" == "yes"]) -AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" == "yes"]) -AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" == "yes"]) -AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" == "yes"]) +AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"]) +AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"]) +AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"]) +AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"]) regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \ -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \ -- cgit v1.2.3 From b7580450b4c669846fe840997984dfaaa9c39a71 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 25 Jun 2008 12:18:23 +0200 Subject: build: ip6.h is not required Remove the check from configure.ac that errors out when ip6.h is not found. The code does not actually depend on any structures from it. Reported-by: anonymous Signed-off-by: Jan Engelhardt Signed-off-by: Patrick McHardy --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2d2f90fd..09e5d0d4 100644 --- a/configure.ac +++ b/configure.ac @@ -38,7 +38,6 @@ AC_ARG_ENABLE([devel], AC_ARG_ENABLE([libipq], AS_HELP_STRING([--enable-libipq], [Build and install libipq])) -AC_CHECK_HEADER([netinet/ip6.h], [], [AC_MSG_ERROR(but we need that for IPv6)]) AC_CHECK_HEADER([linux/dccp.h]) blacklist_modules=""; -- cgit v1.2.3 From 4ded0f11d382c37a57c04077f453b3978eeded17 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 30 Jun 2008 14:57:08 +0200 Subject: libxt_TOS: make sure --set-tos value/mask is recognized Only when a 'stop' pointer is passed, the string may consist of more than just a number. Reported-by: Anonymous Signed-off-by: Jan Engelhardt Signed-off-by: Patrick McHardy --- extensions/tos_values.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/tos_values.c b/extensions/tos_values.c index 1630834e..4c0b0bcb 100644 --- a/extensions/tos_values.c +++ b/extensions/tos_values.c @@ -56,8 +56,9 @@ static bool tos_parse_symbolic(const char *str, struct tos_value_mask *tvm, { const unsigned int max = 255; const struct tos_symbol_info *symbol; + char *tmp; - if (strtonum(str, NULL, NULL, 0, max)) + if (strtonum(str, &tmp, NULL, 0, max)) return tos_parse_numeric(str, tvm, max); /* Do not consider ECN bits */ -- cgit v1.2.3 From 3a72b1f2d3aef3ba1bae80faefe3709e17da523d Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 3 Jul 2008 20:25:42 +0200 Subject: build: quote variables in release.sh Signed-off-by: Jan Engelhardt Signed-off-by: Patrick McHardy --- release.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/release.sh b/release.sh index 5635e4c0..f77ef259 100644 --- a/release.sh +++ b/release.sh @@ -7,14 +7,14 @@ PREV_VERSION=1.4.1 TMPDIR=/tmp/ipt-release IPTDIR="$TMPDIR/iptables-$VERSION" -PATCH=patch-iptables-$PREV_VERSION-$VERSION.bz2 -TARBALL=iptables-$VERSION.tar.bz2 -CHANGELOG=changes-iptables-$PREV_VERSION-$VERSION.txt +PATCH="patch-iptables-$PREV_VERSION-$VERSION.bz2"; +TARBALL="iptables-$VERSION.tar.bz2"; +CHANGELOG="changes-iptables-$PREV_VERSION-$VERSION.txt"; mkdir -p "$TMPDIR" -git shortlog v$PREV_VERSION..v$VERSION > "$TMPDIR/$CHANGELOG" -git diff v$PREV_VERSION..v$VERSION | bzip2 > "$TMPDIR/$PATCH" -git archive --prefix=iptables-$VERSION/ v$VERSION | tar -xC "$TMPDIR/" +git shortlog "v$PREV_VERSION..v$VERSION" > "$TMPDIR/$CHANGELOG" +git diff "v$PREV_VERSION..v$VERSION" | bzip2 > "$TMPDIR/$PATCH" +git archive --prefix="iptables-$VERSION/" "v$VERSION" | tar -xC "$TMPDIR/" cd "$IPTDIR" && { sh autogen.sh @@ -22,9 +22,9 @@ cd "$IPTDIR" && { cd .. } -tar -cjf $TARBALL iptables-$VERSION -gpg -u "Netfilter Core Team" -sb $TARBALL -md5sum $TARBALL > $TARBALL.md5sum +tar -cjf "$TARBALL" "iptables-$VERSION"; +gpg -u "Netfilter Core Team" -sb "$TARBALL"; +md5sum "$TARBALL" >"$TARBALL.md5sum"; -gpg -u "Netfilter Core Team" -sb $PATCH -md5sum $PATCH > $PATCH.md5sum +gpg -u "Netfilter Core Team" -sb "$PATCH"; +md5sum "$PATCH" >"$PATCH.md5sum"; -- cgit v1.2.3 From b669b27dd6ba8b94fbff5fa17ea3ca26ead53bea Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 3 Jul 2008 20:26:56 +0200 Subject: build: various changes to release.sh - do not remove autogen.sh - remove COMMIT_NOTES - it does not apply to git anymore - create SHA1 sums for tarballs and patches Signed-off-by: Jan Engelhardt Signed-off-by: Patrick McHardy --- COMMIT_NOTES | 24 ------------------------ release.sh | 3 ++- 2 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 COMMIT_NOTES diff --git a/COMMIT_NOTES b/COMMIT_NOTES deleted file mode 100644 index 5b6e6f7f..00000000 --- a/COMMIT_NOTES +++ /dev/null @@ -1,24 +0,0 @@ -A quick list of rules for committing stuff into netfilter svn: - -- Always include the Name of the Author/Contributor in the SVN comment - like 'fix for foo (Au Thor)' - -- make sure that you have set the executable bits on an 'extensions/.*-test' - script before adding/committing it to SVN - -- If the commit fixes a bugzilla bug, please include '(Closes: #bugnr)' in - the commit message - -- Make sure you don't commit to svn while a feature freeze is announced - -- For new extensions, there are two possible cases: - 1) header files are just in patch-o-matic patch, you need an - 'extensions/.*-test' script to have a conditional build - 2) header files are in patch-o-matic patch, and copied to - 'netfilter/include/linux/netfilter_xxx'. This way the extension - can be built _unconditionally_, and thus be included in - 'extensions/Makefile'. Make sure to keep the headers in sync! - - Usually '1)' is used, but in case something is expected to show up in the - kernel soon, we should already make userspace support unconditionally. - diff --git a/release.sh b/release.sh index f77ef259..526fb953 100644 --- a/release.sh +++ b/release.sh @@ -18,13 +18,14 @@ git archive --prefix="iptables-$VERSION/" "v$VERSION" | tar -xC "$TMPDIR/" cd "$IPTDIR" && { sh autogen.sh - rm autogen.sh COMMIT_NOTES cd .. } tar -cjf "$TARBALL" "iptables-$VERSION"; gpg -u "Netfilter Core Team" -sb "$TARBALL"; md5sum "$TARBALL" >"$TARBALL.md5sum"; +sha1sum "$TARBALL" >"$TARBALL.sha1sum"; gpg -u "Netfilter Core Team" -sb "$PATCH"; md5sum "$PATCH" >"$PATCH.md5sum"; +sha1sum "$PATCH" >"$PATCH.sha1sum"; -- cgit v1.2.3 From 55dffefc95151b5746a853c8ed71097d7b5a8575 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 3 Jul 2008 20:27:50 +0200 Subject: manpages: various updates - synchronized iptables--ip6tbales manpages - -S option, list of chain names, protocol names - markup updates Signed-off-by: Jan Engelhardt Signed-off-by: Patrick McHardy --- ip6tables.8.in | 319 +++++++++++++++++++++------------------------------------ iptables.8.in | 296 +++++++++++++++++++--------------------------------- 2 files changed, 225 insertions(+), 390 deletions(-) diff --git a/ip6tables.8.in b/ip6tables.8.in index f5d33db1..666616dc 100644 --- a/ip6tables.8.in +++ b/ip6tables.8.in @@ -1,4 +1,4 @@ -.TH IP6TABLES 8 "Jan 22, 2006" "" "" +.TH IP6TABLES 8 "Jul 03, 2008" "" "" .\" .\" Man page written by Andras Kis-Szabo .\" It is based on iptables man page. @@ -27,26 +27,28 @@ .SH NAME ip6tables \- IPv6 packet filter administration .SH SYNOPSIS -.BR "ip6tables [-t table] -[AD] " "chain rule-specification [options]" +\fBip6tables\fP [\fB-t\fP \fItable\fP\fB]\fP {\fB-A\fP|\fB-D\fP} \fIchain rule-specification\fP [\fIoptions...\fP] .br -.BR "ip6tables [-t table] -I " "chain [rulenum] rule-specification [options]" +\fBip6tables\fP [\fB-t\fP \fItable\fP\fB] -I\fP [\fIrulenum\fP] \fIrule-specification\fP [\fIoptions...\fP] .br -.BR "ip6tables [-t table] -R " "chain rulenum rule-specification [options]" +\fBip6tables\fP [\fB-t\fP \fItable\fP\fB] -R\fP \fIrulenum rule-specification\fP [\fIoptions...\fP] .br -.BR "ip6tables [-t table] -D " "chain rulenum [options]" +\fBip6tables\fP [\fB-t\fP \fItable\fP\fB] -D\fP \fIchain rulenum\fP [\fIoptions...\fP] .br -.BR "ip6tables [-t table] -[LFZ] " "[chain] [options]" +\fBip6tables\fP [\fB-t\fP \fItable\fP\fB] -S\fP [\fIchain\fP] .br -.BR "ip6tables [-t table] -N " "chain" +\fBip6tables\fP [\fB-t\fP \fItable\fP\fB]\fP {\fB-F\fP|\fB-L\fP|\fB-Z\fP} [\fIchain\fP] [\fIoptions...\fP] .br -.BR "ip6tables [-t table] -X " "[chain]" +\fBip6tables\fP [\fB-t\fP \fItable\fP\fB] -N\fP \fIchain\fP .br -.BR "ip6tables [-t table] -P " "chain target [options]" +\fBip6tables\fP [\fB-t\fP \fItable\fP\fB] -X\fP [\fIchain\fP] .br -.BR "ip6tables [-t table] -E " "old-chain-name new-chain-name" +\fBip6tables\fP [\fB-t\fP \fItable\fP\fB] -P\fP \fIchain target\fP [\fIoptions...\fP] +.br +\fBip6tables\fP [\fB-t\fP \fItable\fP\fB] -E\fP \fIold-chain-name new-chain-name\fP .SH DESCRIPTION -.B Ip6tables -is used to set up, maintain, and inspect the tables of IPv6 packet +\fBIp6tables\fP is used to set up, maintain, and inspect the +tables of IPv6 packet filter rules in the Linux kernel. Several different tables may be defined. Each table contains a number of built-in chains and may also contain user-defined chains. @@ -57,48 +59,34 @@ a `target', which may be a jump to a user-defined chain in the same table. .SH TARGETS -A firewall rule specifies criteria for a packet, and a target. If the +A firewall rule specifies criteria for a packet and a target. If the packet does not match, the next rule in the chain is the examined; if it does match, then the next rule is specified by the value of the target, which can be the name of a user-defined chain or one of the -special values -.IR ACCEPT , -.IR DROP , -.IR QUEUE , -or -.IR RETURN . +special values \fBACCEPT\fP, \fBDROP\fP, \fBQUEUE\fP or \fBRETURN\fP. .PP -.I ACCEPT -means to let the packet through. -.I DROP -means to drop the packet on the floor. -.I QUEUE -means to pass the packet to userspace. (How the packet can be received +\fBACCEPT\fP means to let the packet through. +\fBDROP\fP means to drop the packet on the floor. +\fBQUEUE\fP means to pass the packet to userspace. +(How the packet can be received by a userspace process differs by the particular queue handler. 2.4.x -and 2.6.x kernels up to 2.6.13 include the -.B -ip_queue -queue handler. Kernels 2.6.14 and later additionally include the -.B -nfnetlink_queue -queue handler. Packets with a target of QUEUE will be sent to queue number '0' -in this case. Please also see the -.B -NFQUEUE +and 2.6.x kernels up to 2.6.13 include the \fBip_queue\fP +queue handler. Kernels 2.6.14 and later additionally include the +\fBnfnetlink_queue\fP queue handler. Packets with a target of QUEUE will be +sent to queue number '0' in this case. Please also see the \fBNFQUEUE\fP target as described later in this man page.) -.I RETURN -means stop traversing this chain and resume at the next rule in the +\fBRETURN\fP means stop traversing this chain and resume at the next +rule in the previous (calling) chain. If the end of a built-in chain is reached -or a rule in a built-in chain with target -.I RETURN +or a rule in a built-in chain with target \fBRETURN\fP is matched, the target specified by the chain policy determines the fate of the packet. .SH TABLES -There are currently two independent tables (which tables are present +There are currently three independent tables (which tables are present at any time depends on the kernel configuration options and which -modules are present), as nat table has not been implemented yet. +modules are present). .TP -.BI "-t, --table " "table" +\fB-t\fP, \fB--table\fP \fItable\fP This option specifies the packet matching table which the command should operate on. If the kernel is configured with automatic module loading, an attempt will be made to load the appropriate module for @@ -107,132 +95,121 @@ that table if it is not already there. The tables are as follows: .RS .TP .4i -.BR "filter" : +\fBfilter\fP: This is the default table (if no -t option is passed). It contains -the built-in chains -.B INPUT -(for packets coming into the box itself), -.B FORWARD -(for packets being routed through the box), and -.B OUTPUT -(for locally-generated packets). +the built-in chains \fBINPUT\fP (for packets destined to local sockets), +\fBFORWARD\fP (for packets being routed through the box), and +\fBOUTPUT\fP (for locally-generated packets). .TP -.BR "mangle" : +\fBmangle\fP: This table is used for specialized packet alteration. Until kernel -2.4.17 it had two built-in chains: -.B PREROUTING -(for altering incoming packets before routing) and -.B OUTPUT +2.4.17 it had two built-in chains: \fBPREROUTING\fP +(for altering incoming packets before routing) and \fBOUTPUT\fP (for altering locally-generated packets before routing). Since kernel 2.4.18, three other built-in chains are also supported: -.B INPUT -(for packets coming into the box itself), -.B FORWARD -(for altering packets being routed through the box), and -.B POSTROUTING +\fBINPUT\fP (for packets coming into the box itself), \fBFORWARD\fP +(for altering packets being routed through the box), and \fBPOSTROUTING\fP (for altering packets as they are about to go out). .TP -.BR "raw" : +\fBraw\fP: 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 nf_conntrack, or any other -IP6 tables. It provides the following built-in chains: -.B PREROUTING -(for packets arriving via any network interface) -.B OUTPUT +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) .RE .SH OPTIONS The options that are recognized by -.B ip6tables -can be divided into several different groups. +\fBip6tables\fP can be divided into several different groups. .SS COMMANDS These options specify the specific action to perform. Only one of them can be specified on the command line unless otherwise specified below. For all the long versions of the command and option names, you need to use only enough letters to ensure that -.B ip6tables -can differentiate it from all other options. +\fBip6tables\fP can differentiate it from all other options. .TP -.BI "-A, --append " "chain rule-specification" +\fB-A\fP, \fB--append\fP \fIchain rule-specification\fP Append one or more rules to the end of the selected chain. When the source and/or destination names resolve to more than one address, a rule will be added for each possible address combination. .TP -.BI "-D, --delete " "chain rule-specification" +\fB-D\fP, \fB--delete\fP \fIchain rule-specification\fP .ns .TP -.BI "-D, --delete " "chain rulenum" +\fB-D\fP, \fB--delete\fP \fIchain rulenum\fP Delete one or more rules from the selected chain. There are two versions of this command: the rule can be specified as a number in the chain (starting at 1 for the first rule) or a rule to match. .TP -.B "-I, --insert" +\fB-I\fP, \fB--insert\fP \fIchain\fP [\fIrulenum\fP] \fIrule-specification\fP Insert one or more rules in the selected chain as the given rule number. So, if the rule number is 1, the rule or rules are inserted at the head of the chain. This is also the default if no rule number is specified. .TP -.BI "-R, --replace " "chain rulenum rule-specification" +\fB-R\fP, \fB--replace\fP \fIchain rulenum rule-specification\fP Replace a rule in the selected chain. If the source and/or destination names resolve to multiple addresses, the command will fail. Rules are numbered starting at 1. .TP -.BR "-L, --list " "[\fIchain\fP]" +\fB-L\fP, \fB--list\fP [\fIchain\fP] List all rules in the selected chain. If no chain is selected, all -chains are listed. As every other iptables command, it applies to the -specified table (filter is the default), so mangle rules get listed by +chains are listed. Like every other iptables command, it applies to the +specified table (filter is the default), so NAT rules get listed by .nf - ip6tables -t mangle -n -L + iptables -t nat -n -L .fi -Please note that it is often used with the -.B -n +Please note that it is often used with the \fB-n\fP option, in order to avoid long reverse DNS lookups. -It is legal to specify the -.B -Z +It is legal to specify the \fB-Z\fP (zero) option as well, in which case the chain(s) will be atomically listed and zeroed. The exact output is affected by the other arguments given. The exact rules are suppressed until you use .nf - ip6tables -L -v + iptables -L -v .fi .TP -.BR "-S, --list-rules " "[\fIchain\fP]" +\fB-S\fP, \fB--list-rules\fP [\fIchain\fP] Print all rules in the selected chain. If no chain is selected, all chains are printed like iptables-save. Like every other iptables command, it applies to the specified table (filter is the default). .TP -.BR "-F, --flush " "[\fIchain\fP]" +\fB-F\fP, \fB--flush\fP [\fIchain\fP] Flush the selected chain (all the chains in the table if none is given). This is equivalent to deleting all the rules one by one. .TP -.BR "-Z, --zero " "[\fIchain\fP]" +\fB-Z\fP, \fB--zero\fP [\fIchain\fP] Zero the packet and byte counters in all chains. It is legal to specify the -.B "-L, --list" +\fB-L\fP, \fB--list\fP (list) option as well, to see the counters immediately before they are cleared. (See above.) .TP -.BI "-N, --new-chain " "chain" +\fB-N\fP, \fB--new-chain\fP \fIchain\fP Create a new user-defined chain by the given name. There must be no target of that name already. .TP -.BR "-X, --delete-chain " "[\fIchain\fP]" +\fB-X\fP, \fB--delete-chain\fP [\fIchain\fP] Delete the optional user-defined chain specified. There must be no references -to the chain. If there are, you must delete or replace the referring -rules before the chain can be deleted. If no argument is given, it -will attempt to delete every non-builtin chain in the table. +to the chain. If there are, you must delete or replace the referring rules +before the chain can be deleted. The chain must be empty, i.e. not contain +any rules. If no argument is given, it will attempt to delete every +non-builtin chain in the table. .TP -.BI "-P, --policy " "chain target" -Set the policy for the chain to the given target. See the section -.B TARGETS +\fB-P\fP, \fB--policy\fP \fIchain target\fP +Set the policy for the chain to the given target. See the section \fBTARGETS\fP for the legal targets. Only built-in (non-user-defined) chains can have policies, and neither built-in nor user-defined chains can be policy targets. .TP -.BI "-E, --rename-chain " "old-chain new-chain" +\fB-E\fP, \fB--rename-chain\fP \fIold-chain new-chain\fP Rename the user specified chain to the user supplied name. This is cosmetic, and has no effect on the structure of the table. +.BI "-A, --append " "chain rule-specification" +Append one or more rules to the end of the selected chain. +When the source and/or destination names resolve to more than one +address, a rule will be added for each possible address combination. .TP .B -h Help. @@ -241,179 +218,130 @@ Give a (currently very brief) description of the command syntax. The following parameters make up a rule specification (as used in the add, delete, insert, replace and append commands). .TP -.BR "-p, --protocol " "[!] \fIprotocol\fP" +[\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 -.IR tcp , -.IR udp , -.IR icmpv6 , -.IR esp , -.IR all , +The specified protocol can be one of \fBtcp\fP, \fBudp\fP, \fBudplite\fP, +\fBicmpv6\fP, \fBesp\fP, \fBmh\fP or \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. -But IPv6 extension headers except -.IR esp -are not allowed. -.IR esp , -and -.IR ipv6-nonext +But IPv6 extension headers except \fBesp\fP are not allowed. +\fBesp\fP and \fBipv6-nonext\fP can be used with Kernel version 2.6.11 or later. A "!" argument before the protocol inverts the -test. The number zero is equivalent to -.IR all . -Protocol -.I all +test. The number zero is equivalent to \fBall\fP. +Protocol \fBall\fP will match with all protocols and is taken as default when this option is omitted. .TP -.BR "-s, --source " "[!] \fIaddress\fP[/\fImask\fP]" +[\fB!\fP] \fB-s\fP, \fB--source\fP \fIaddress\fP[\fB/\fP\fImask\fP] Source specification. -.I Address -can be either a hostname (please note that specifying +\fIAddress\fP can be either a hostname (please note that specifying any name to be resolved with a remote query such as DNS is a really bad idea), -a network IPv6 address (with /mask), or a plain IPv6 address. +a network IPv6 address (with \fB/\fP\fImask\fP), or a plain IPv6 address. (the network name isn't supported now). -The -.I mask -can be either a network mask or a plain number, +The \fImask\fP is a plain number, specifying the number of 1's at the left side of the network mask. -Thus, a mask of -.I 64 -is equivalent to -.IR ffff:ffff:ffff:ffff:0000:0000:0000:0000 . A "!" argument before the address specification inverts the sense of -the address. The flag -.B --src +the address. The flag \fB--src\fP is an alias for this option. .TP -.BR "-d, --destination " "[!] \fIaddress\fP[/\fImask\fP]" +[\fB!\fP] \fB-d\fP, \fB--destination\fP \fIaddress\fP[\fB/\fP\fImask\fP] Destination specification. -See the description of the -.B -s +See the description of the \fB-s\fP (source) flag for a detailed description of the syntax. The flag -.B --dst -is an alias for this option. +\fB--dst\fP is an alias for this option. .TP -.BI "-j, --jump " "target" +\fB-j\fP, \fB--jump\fP \fItarget\fP 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 -.B EXTENSIONS +the fate of the packet immediately, or an extension (see \fBEXTENSIONS\fP below). If this -option is omitted in a rule (and -.B -g +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 incremented. .TP -.BI "-g, --goto " "chain" +\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 processing in this chain but instead in the chain that called us via --jump. .TP -.BR "-i, --in-interface " "[!] \fIname\fP" -Name of an interface via which a packet is going to be received (only for -packets entering the -.BR INPUT , -.B FORWARD -and -.B PREROUTING +[\fB!\fP] \fB-i\fP, \fB--in-interface\fP \fIname\fP +Name of an interface via which a packet was received (only for +packets entering the \fBINPUT\fP, \fBFORWARD\fP and \fBPREROUTING\fP chains). When the "!" argument is used before the interface name, the sense is inverted. If the interface name ends in a "+", then any interface which begins with this name will match. If this option is omitted, any interface name will match. .TP -.BR "-o, --out-interface " "[!] \fIname\fP" +[\fB!\fP] \fB-o\fP, \fB--out-interface\fP \fIname\fP Name of an interface via which a packet is going to be sent (for packets -entering the -.BR FORWARD -and -.B OUTPUT +entering the \fBFORWARD\fP, \fBOUTPUT\fP and \fBPOSTROUTING\fP chains). When the "!" argument is used before the interface name, the sense is inverted. If the interface name ends in a "+", then any interface which begins with this name will match. If this option is omitted, any interface name will match. -.TP .\" Currently not supported (header-based) -.\" -.\" .B "[!] " "-f, --fragment" +.\" .TP +.\" [\fB!\fP] \fB-f\fP, \fB--fragment\fP .\" This means that the rule only refers to second and further fragments .\" of fragmented packets. Since there is no way to tell the source or .\" destination ports of such a packet (or ICMP type), such a packet will .\" not match any rules which specify them. When the "!" argument .\" precedes the "-f" flag, the rule will only match head fragments, or .\" unfragmented packets. -.\" .TP -.B "-c, --set-counters " "PKTS BYTES" +.TP +\fB-c\fP, \fB--set-counters\fP \fIpackets bytes\fP This enables the administrator to initialize the packet and byte -counters of a rule (during -.B INSERT, -.B APPEND, -.B REPLACE +counters of a rule (during \fBINSERT\fP, \fBAPPEND\fP, \fBREPLACE\fP operations). .SS "OTHER OPTIONS" The following additional options can be specified: .TP -.B "-v, --verbose" +\fB-v\fP, \fB--verbose\fP Verbose output. This option makes the list command show the interface name, the rule options (if any), and the TOS masks. The packet and byte counters are also listed, with the suffix 'K', 'M' or 'G' for 1000, 1,000,000 and 1,000,000,000 multipliers respectively (but see -the -.B -x -flag to change this). +the \fB-x\fP flag to change this). For appending, insertion, deletion and replacement, this causes detailed information on the rule or rules to be printed. .TP -.B "-n, --numeric" +\fB-n\fP, \fB--numeric\fP Numeric output. IP addresses and port numbers will be printed in numeric format. By default, the program will try to display them as host names, network names, or services (whenever applicable). .TP -.B "-x, --exact" +\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) M's (multiples of 1000K) or G's (multiples of 1000M). This option is -only relevant for the -.B -L -command. +only relevant for the \fB-L\fP command. .TP .B "--line-numbers" When listing rules, add line numbers to the beginning of each rule, corresponding to that rule's position in the chain. .TP -.B "--modprobe=command" -When adding or inserting rules into a chain, use -.B command +\fB--modprobe=\fP\fIcommand\fP +When adding or inserting rules into a chain, use \fIcommand\fP to load any necessary modules (targets, match extensions, etc). .SH MATCH EXTENSIONS ip6tables can use extended packet matching modules. These are loaded -in two ways: implicitly, when -.B -p -or -.B --protocol -is specified, or with the -.B -m -or -.B --match +in two ways: implicitly, when \fB-p\fP or \fB--protocol\fP +is specified, or with the \fB-m\fP or \fB--match\fP options, followed by the matching module name; after these, various extra command line options become available, depending on the specific module. You can specify multiple extended match modules in one line, -and you can use the -.B -h -or -.B --help +and you can use the \fB-h\fP or \fB--help\fP options after the module has been specified to receive help specific to that module. The following are included in the base package, and most of these can -be preceded by a -.B ! -to invert the sense of the match. +be preceded by a "\fB!\fP" to invert the sense of the match. .\" @MATCH@ .SH TARGET EXTENSIONS ip6tables can use extended target modules: the following are included @@ -428,27 +356,18 @@ other errors cause an exit code of 1. Bugs? What's this? ;-) Well... the counters are not reliable on sparc64. .SH COMPATIBILITY WITH IPCHAINS -This -.B ip6tables +This \fBip6tables\fP is very similar to ipchains by Rusty Russell. The main difference is -that the chains -.B INPUT -and -.B OUTPUT +that the chains \fBINPUT\fP and \fBOUTPUT\fP are only traversed for packets coming into the local host and originating from the local host respectively. Hence every packet only passes through one of the three chains (except loopback traffic, which involves both INPUT and OUTPUT chains); previously a forwarded packet would pass through all three. .PP -The other main difference is that -.B -i -refers to the input interface; -.B -o -refers to the output interface, and both are available for packets -entering the -.B FORWARD -chain. +The other main difference is that \fB-i\fP refers to the input interface; +\fB-o\fP refers to the output interface, and both are available for packets +entering the \fBFORWARD\fP chain. .\" .PP The various forms of NAT have been separated out; .\" .B iptables .\" is a pure packet filter when using the default `filter' table, with diff --git a/iptables.8.in b/iptables.8.in index 0b945cb7..c08d27db 100644 --- a/iptables.8.in +++ b/iptables.8.in @@ -1,4 +1,4 @@ -.TH IPTABLES 8 "Mar 09, 2002" "" "" +.TH IPTABLES 8 "Jul 03, 2008" "" "" .\" .\" Man page written by Herve Eychenne (May 1999) .\" It is based on ipchains page. @@ -25,26 +25,28 @@ .SH NAME iptables \- administration tool for IPv4 packet filtering and NAT .SH SYNOPSIS -.BR "iptables [-t table] -[AD] " "chain rule-specification [options]" +\fBiptables\fP [\fB-t\fP \fItable\fP\fB]\fP {\fB-A\fP|\fB-D\fP} \fIchain rule-specification\fP [\fIoptions...\fP] .br -.BR "iptables [-t table] -I " "chain [rulenum] rule-specification [options]" +\fBiptables\fP [\fB-t\fP \fItable\fP\fB] -I\fP [\fIrulenum\fP] \fIrule-specification\fP [\fIoptions...\fP] .br -.BR "iptables [-t table] -R " "chain rulenum rule-specification [options]" +\fBiptables\fP [\fB-t\fP \fItable\fP\fB] -R\fP \fIrulenum rule-specification\fP [\fIoptions...\fP] .br -.BR "iptables [-t table] -D " "chain rulenum [options]" +\fBiptables\fP [\fB-t\fP \fItable\fP\fB] -D\fP \fIchain rulenum\fP [\fIoptions...\fP] .br -.BR "iptables [-t table] -[LFZ] " "[chain] [options]" +\fBiptables\fP [\fB-t\fP \fItable\fP\fB] -S\fP [\fIchain\fP] .br -.BR "iptables [-t table] -N " "chain" +\fBiptables\fP [\fB-t\fP \fItable\fP\fB]\fP {\fB-F\fP|\fB-L\fP|\fB-Z\fP} [\fIchain\fP] [\fIoptions...\fP] .br -.BR "iptables [-t table] -X " "[chain]" +\fBiptables\fP [\fB-t\fP \fItable\fP\fB] -N\fP \fIchain\fP .br -.BR "iptables [-t table] -P " "chain target [options]" +\fBiptables\fP [\fB-t\fP \fItable\fP\fB] -X\fP [\fIchain\fP] .br -.BR "iptables [-t table] -E " "old-chain-name new-chain-name" +\fBiptables\fP [\fB-t\fP \fItable\fP\fB] -P\fP \fIchain target\fP [\fIoptions...\fP] +.br +\fBiptables\fP [\fB-t\fP \fItable\fP\fB] -E\fP \fIold-chain-name new-chain-name\fP .SH DESCRIPTION -.B Iptables -is used to set up, maintain, and inspect the tables of IP packet +\fBIptables\fP is used to set up, maintain, and inspect the +tables of IPv4 packet filter rules in the Linux kernel. Several different tables may be defined. Each table contains a number of built-in chains and may also contain user-defined chains. @@ -59,36 +61,22 @@ A firewall rule specifies criteria for a packet and a target. If the packet does not match, the next rule in the chain is the examined; if it does match, then the next rule is specified by the value of the target, which can be the name of a user-defined chain or one of the -special values -.IR ACCEPT , -.IR DROP , -.IR QUEUE , -or -.IR RETURN . +special values \fBACCEPT\fP, \fBDROP\fP, \fBQUEUE\fP or \fBRETURN\fP. .PP -.I ACCEPT -means to let the packet through. -.I DROP -means to drop the packet on the floor. -.I QUEUE -means to pass the packet to userspace. (How the packet can be received +\fBACCEPT\fP means to let the packet through. +\fBDROP\fP means to drop the packet on the floor. +\fBQUEUE\fP means to pass the packet to userspace. +(How the packet can be received by a userspace process differs by the particular queue handler. 2.4.x -and 2.6.x kernels up to 2.6.13 include the -.B -ip_queue -queue handler. Kernels 2.6.14 and later additionally include the -.B -nfnetlink_queue -queue handler. Packets with a target of QUEUE will be sent to queue number '0' -in this case. Please also see the -.B -NFQUEUE +and 2.6.x kernels up to 2.6.13 include the \fBip_queue\fP +queue handler. Kernels 2.6.14 and later additionally include the +\fBnfnetlink_queue\fP queue handler. Packets with a target of QUEUE will be +sent to queue number '0' in this case. Please also see the \fBNFQUEUE\fP target as described later in this man page.) -.I RETURN -means stop traversing this chain and resume at the next rule in the +\fBRETURN\fP means stop traversing this chain and resume at the next +rule in the previous (calling) chain. If the end of a built-in chain is reached -or a rule in a built-in chain with target -.I RETURN +or a rule in a built-in chain with target \fBRETURN\fP is matched, the target specified by the chain policy determines the fate of the packet. .SH TABLES @@ -96,7 +84,7 @@ There are currently three independent tables (which tables are present at any time depends on the kernel configuration options and which modules are present). .TP -.BI "-t, --table " "table" +\fB-t\fP, \fB--table\fP \fItable\fP This option specifies the packet matching table which the command should operate on. If the kernel is configured with automatic module loading, an attempt will be made to load the appropriate module for @@ -105,99 +93,81 @@ that table if it is not already there. The tables are as follows: .RS .TP .4i -.BR "filter" : +\fBfilter\fP: This is the default table (if no -t option is passed). It contains -the built-in chains -.B INPUT -(for packets destined to local sockets), -.B FORWARD -(for packets being routed through the box), and -.B OUTPUT -(for locally-generated packets). -.TP -.BR "nat" : +the built-in chains \fBINPUT\fP (for packets destined to local sockets), +\fBFORWARD\fP (for packets being routed through the box), and +\fBOUTPUT\fP (for locally-generated packets). +.TP +\fBnat\fP: This table is consulted when a packet that creates a new -connection is encountered. It consists of three built-ins: -.B PREROUTING -(for altering packets as soon as they come in), -.B OUTPUT -(for altering locally-generated packets before routing), and -.B POSTROUTING +connection is encountered. It consists of three built-ins: \fBPREROUTING\fP +(for altering packets as soon as they come in), \fBOUTPUT\fP +(for altering locally-generated packets before routing), and \fBPOSTROUTING\fP (for altering packets as they are about to go out). .TP -.BR "mangle" : +\fBmangle\fP: This table is used for specialized packet alteration. Until kernel -2.4.17 it had two built-in chains: -.B PREROUTING -(for altering incoming packets before routing) and -.B OUTPUT +2.4.17 it had two built-in chains: \fBPREROUTING\fP +(for altering incoming packets before routing) and \fBOUTPUT\fP (for altering locally-generated packets before routing). Since kernel 2.4.18, three other built-in chains are also supported: -.B INPUT -(for packets coming into the box itself), -.B FORWARD -(for altering packets being routed through the box), and -.B POSTROUTING +\fBINPUT\fP (for packets coming into the box itself), \fBFORWARD\fP +(for altering packets being routed through the box), and \fBPOSTROUTING\fP (for altering packets as they are about to go out). .TP -.BR "raw" : +\fBraw\fP: 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: -.B PREROUTING -(for packets arriving via any network interface) -.B OUTPUT +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) .RE .SH OPTIONS The options that are recognized by -.B iptables -can be divided into several different groups. +\fBiptables\fP can be divided into several different groups. .SS COMMANDS These options specify the desired action to perform. Only one of them can be specified on the command line unless otherwise stated below. For long versions of the command and option names, you need to use only enough letters to ensure that -.B iptables -can differentiate it from all other options. +\fBiptables\fP can differentiate it from all other options. .TP -.BI "-A, --append " "chain rule-specification" +\fB-A\fP, \fB--append\fP \fIchain rule-specification\fP Append one or more rules to the end of the selected chain. When the source and/or destination names resolve to more than one address, a rule will be added for each possible address combination. .TP -.BI "-D, --delete " "chain rule-specification" +\fB-D\fP, \fB--delete\fP \fIchain rule-specification\fP .ns .TP -.BI "-D, --delete " "chain rulenum" +\fB-D\fP, \fB--delete\fP \fIchain rulenum\fP Delete one or more rules from the selected chain. There are two versions of this command: the rule can be specified as a number in the chain (starting at 1 for the first rule) or a rule to match. .TP -.BR "-I, --insert " "\fIchain\fP [\fIrulenum\fP] \fIrule-specification\fP" +\fB-I\fP, \fB--insert\fP \fIchain\fP [\fIrulenum\fP] \fIrule-specification\fP Insert one or more rules in the selected chain as the given rule number. So, if the rule number is 1, the rule or rules are inserted at the head of the chain. This is also the default if no rule number is specified. .TP -.BI "-R, --replace " "chain rulenum rule-specification" +\fB-R\fP, \fB--replace\fP \fIchain rulenum rule-specification\fP Replace a rule in the selected chain. If the source and/or destination names resolve to multiple addresses, the command will fail. Rules are numbered starting at 1. .TP -.BR "-L, --list " "[\fIchain\fP]" +\fB-L\fP, \fB--list\fP [\fIchain\fP] List all rules in the selected chain. If no chain is selected, all chains are listed. Like every other iptables command, it applies to the specified table (filter is the default), so NAT rules get listed by .nf iptables -t nat -n -L .fi -Please note that it is often used with the -.B -n +Please note that it is often used with the \fB-n\fP option, in order to avoid long reverse DNS lookups. -It is legal to specify the -.B -Z +It is legal to specify the \fB-Z\fP (zero) option as well, in which case the chain(s) will be atomically listed and zeroed. The exact output is affected by the other arguments given. The exact rules are suppressed until you use @@ -205,41 +175,40 @@ arguments given. The exact rules are suppressed until you use iptables -L -v .fi .TP -.BR "-S, --list-rules " "[\fIchain\fP]" +\fB-S\fP, \fB--list-rules\fP [\fIchain\fP] Print all rules in the selected chain. If no chain is selected, all chains are printed like iptables-save. Like every other iptables command, it applies to the specified table (filter is the default). .TP -.BR "-F, --flush " "[\fIchain\fP]" +\fB-F\fP, \fB--flush\fP [\fIchain\fP] Flush the selected chain (all the chains in the table if none is given). This is equivalent to deleting all the rules one by one. .TP -.BR "-Z, --zero " "[\fIchain\fP]" +\fB-Z\fP, \fB--zero\fP [\fIchain\fP] Zero the packet and byte counters in all chains. It is legal to specify the -.B "-L, --list" +\fB-L\fP, \fB--list\fP (list) option as well, to see the counters immediately before they are cleared. (See above.) .TP -.BI "-N, --new-chain " "chain" +\fB-N\fP, \fB--new-chain\fP \fIchain\fP Create a new user-defined chain by the given name. There must be no target of that name already. .TP -.BR "-X, --delete-chain " "[\fIchain\fP]" +\fB-X\fP, \fB--delete-chain\fP [\fIchain\fP] Delete the optional user-defined chain specified. There must be no references to the chain. If there are, you must delete or replace the referring rules before the chain can be deleted. The chain must be empty, i.e. not contain any rules. If no argument is given, it will attempt to delete every non-builtin chain in the table. .TP -.BI "-P, --policy " "chain target" -Set the policy for the chain to the given target. See the section -.B TARGETS +\fB-P\fP, \fB--policy\fP \fIchain target\fP +Set the policy for the chain to the given target. See the section \fBTARGETS\fP for the legal targets. Only built-in (non-user-defined) chains can have policies, and neither built-in nor user-defined chains can be policy targets. .TP -.BI "-E, --rename-chain " "old-chain new-chain" +\fB-E\fP, \fB--rename-chain\fP \fIold-chain new-chain\fP Rename the user specified chain to the user supplied name. This is cosmetic, and has no effect on the structure of the table. .TP @@ -250,95 +219,70 @@ Give a (currently very brief) description of the command syntax. The following parameters make up a rule specification (as used in the add, delete, insert, replace and append commands). .TP -.BR "-p, --protocol " "[!] \fIprotocol\fP" +[\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 -.IR tcp , -.IR udp , -.IR icmp , -or -.IR all , +The specified protocol can be one of \fBtcp\fP, \fBudp\fP, \fBudplite\fP, +\fBicmp\fP, \fBesp\fP, \fBah\fP, \fBsctp\fP or \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 -test. The number zero is equivalent to -.IR all . -Protocol -.I all +test. The number zero is equivalent to \fBall\fP. +Protocol \fBall\fP will match with all protocols and is taken as default when this option is omitted. .TP -.BR "-s, --source " "[!] \fIaddress\fP[/\fImask\fP]" -Source specification. -.I Address +[\fB!\fP] \fB-s\fP, \fB--source\fP \fIaddress\fP[\fB/\fP\fImask\fP] +Source specification. \fIAddress\fP can be either a network name, a hostname (please note that specifying any name to be resolved with a remote query such as DNS is a really bad idea), -a network IP address (with /mask), or a plain IP address. -The -.I mask +a network IP address (with \fB/\fP\fImask\fP), or a plain IP address. +The \fImask\fP can be either a network mask or a plain number, specifying the number of 1's at the left side of the network mask. -Thus, a mask of -.I 24 -is equivalent to -.IR 255.255.255.0 . +Thus, a mask of \fI24\fP is equivalent to \fI255.255.255.0\fP. A "!" argument before the address specification inverts the sense of -the address. The flag -.B --src -is an alias for this option. +the address. The flag \fB--src\fP is an alias for this option. .TP -.BR "-d, --destination " "[!] \fIaddress\fP[/\fImask\fP]" +[\fB!\fP] \fB-d\fP, \fB--destination\fP \fIaddress\fP[\fB/\fP\fImask\fP] Destination specification. -See the description of the -.B -s +See the description of the \fB-s\fP (source) flag for a detailed description of the syntax. The flag -.B --dst -is an alias for this option. +\fB--dst\fP is an alias for this option. .TP -.BI "-j, --jump " "target" +\fB-j\fP, \fB--jump\fP \fItarget\fP 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 -.B EXTENSIONS +the fate of the packet immediately, or an extension (see \fBEXTENSIONS\fP below). If this -option is omitted in a rule (and -.B -g +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 incremented. .TP -.BI "-g, --goto " "chain" +\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 processing in this chain but instead in the chain that called us via --jump. .TP -.BR "-i, --in-interface " "[!] \fIname\fP" +[\fB!\fP] \fB-i\fP, \fB--in-interface\fP \fIname\fP Name of an interface via which a packet was received (only for -packets entering the -.BR INPUT , -.B FORWARD -and -.B PREROUTING +packets entering the \fBINPUT\fP, \fBFORWARD\fP and \fBPREROUTING\fP chains). When the "!" argument is used before the interface name, the sense is inverted. If the interface name ends in a "+", then any interface which begins with this name will match. If this option is omitted, any interface name will match. .TP -.BR "-o, --out-interface " "[!] \fIname\fP" +[\fB!\fP] \fB-o\fP, \fB--out-interface\fP \fIname\fP Name of an interface via which a packet is going to be sent (for packets -entering the -.BR FORWARD , -.B OUTPUT -and -.B POSTROUTING +entering the \fBFORWARD\fP, \fBOUTPUT\fP and \fBPOSTROUTING\fP chains). When the "!" argument is used before the interface name, the sense is inverted. If the interface name ends in a "+", then any interface which begins with this name will match. If this option is omitted, any interface name will match. .TP -.B "[!] " "-f, --fragment" +[\fB!\fP] \fB-f\fP, \fB--fragment\fP This means that the rule only refers to second and further fragments of fragmented packets. Since there is no way to tell the source or destination ports of such a packet (or ICMP type), such a packet will @@ -346,74 +290,55 @@ not match any rules which specify them. When the "!" argument precedes the "-f" flag, the rule will only match head fragments, or unfragmented packets. .TP -.BI "-c, --set-counters " "PKTS BYTES" +\fB-c\fP, \fB--set-counters\fP \fIpackets bytes\fP This enables the administrator to initialize the packet and byte -counters of a rule (during -.B INSERT, -.B APPEND, -.B REPLACE +counters of a rule (during \fBINSERT\fP, \fBAPPEND\fP, \fBREPLACE\fP operations). .SS "OTHER OPTIONS" The following additional options can be specified: .TP -.B "-v, --verbose" +\fB-v\fP, \fB--verbose\fP Verbose output. This option makes the list command show the interface name, the rule options (if any), and the TOS masks. The packet and byte counters are also listed, with the suffix 'K', 'M' or 'G' for 1000, 1,000,000 and 1,000,000,000 multipliers respectively (but see -the -.B -x -flag to change this). +the \fB-x\fP flag to change this). For appending, insertion, deletion and replacement, this causes detailed information on the rule or rules to be printed. .TP -.B "-n, --numeric" +\fB-n\fP, \fB--numeric\fP Numeric output. IP addresses and port numbers will be printed in numeric format. By default, the program will try to display them as host names, network names, or services (whenever applicable). .TP -.B "-x, --exact" +\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) M's (multiples of 1000K) or G's (multiples of 1000M). This option is -only relevant for the -.B -L -command. +only relevant for the \fB-L\fP command. .TP .B "--line-numbers" When listing rules, add line numbers to the beginning of each rule, corresponding to that rule's position in the chain. .TP -.B "--modprobe=command" -When adding or inserting rules into a chain, use -.B command +\fB--modprobe=\fP\fIcommand\fP +When adding or inserting rules into a chain, use \fIcommand\fP to load any necessary modules (targets, match extensions, etc). .SH MATCH EXTENSIONS iptables can use extended packet matching modules. These are loaded -in two ways: implicitly, when -.B -p -or -.B --protocol -is specified, or with the -.B -m -or -.B --match +in two ways: implicitly, when \fB-p\fP or \fB--protocol\fP +is specified, or with the \fB-m\fP or \fB--match\fP options, followed by the matching module name; after these, various extra command line options become available, depending on the specific module. You can specify multiple extended match modules in one line, -and you can use the -.B -h -or -.B --help +and you can use the \fB-h\fP or \fB--help\fP options after the module has been specified to receive help specific to that module. The following are included in the base package, and most of these can -be preceded by a -.B ! -to invert the sense of the match. +be preceded by a "\fB!\fP" to invert the sense of the match. .\" @MATCH@ .SH TARGET EXTENSIONS iptables can use extended target modules: the following are included @@ -428,29 +353,20 @@ other errors cause an exit code of 1. Bugs? What's this? ;-) Well, you might want to have a look at http://bugzilla.netfilter.org/ .SH COMPATIBILITY WITH IPCHAINS -This -.B iptables +This \fBiptables\fP is very similar to ipchains by Rusty Russell. The main difference is -that the chains -.B INPUT -and -.B OUTPUT +that the chains \fBINPUT\fP and \fBOUTPUT\fP are only traversed for packets coming into the local host and originating from the local host respectively. Hence every packet only passes through one of the three chains (except loopback traffic, which involves both INPUT and OUTPUT chains); previously a forwarded packet would pass through all three. .PP -The other main difference is that -.B -i -refers to the input interface; -.B -o -refers to the output interface, and both are available for packets -entering the -.B FORWARD -chain. -.PP The various forms of NAT have been separated out; -.B iptables +The other main difference is that \fB-i\fP refers to the input interface; +\fB-o\fP refers to the output interface, and both are available for packets +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 confusion over the combination of IP masquerading and packet filtering -- cgit v1.2.3 From 526d3e138635e33773d1ca16477052a04f53f5bd Mon Sep 17 00:00:00 2001 From: Jesper Dangaard Brouer Date: Thu, 3 Jul 2008 20:29:34 +0200 Subject: libiptc: minor bugfix Minor bugfix, an extra check is needed if the tail element is a builtin chain, as builtin chains are not sorted. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Patrick McHardy --- libiptc/libiptc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index d0f51b4a..ec5317bc 100644 --- a/libiptc/libiptc.c +++ b/libiptc/libiptc.c @@ -819,7 +819,8 @@ static void __iptcc_p_add_chain(TC_HANDLE_T h, struct chain_head *c, list_add_tail(&c->list, &h->chains); else { ctail = list_entry(tail, struct chain_head, list); - if (strcmp(c->name, ctail->name) > 0) + if (strcmp(c->name, ctail->name) > 0 || + iptcc_is_builtin(ctail)) list_add_tail(&c->list, &h->chains);/* Already sorted*/ else iptc_insert_chain(h, c);/* Was not sorted */ -- cgit v1.2.3 From 4bae3f1001028ee283a5e1fcea4a561b0068f95d Mon Sep 17 00:00:00 2001 From: Jesper Dangaard Brouer Date: Thu, 3 Jul 2008 20:31:42 +0200 Subject: libiptc: fix scalability performance issue during initial ruleset parsing Finding jump chains is slow O(Chain*Rules). The problem: is that the chain list is searched lineary for each rule with a jump target. The problem lies in the "second pass" (of function parse_table) where the userchain jump targets are found. For each rule "R" with a IPTCC_R_JUMP target, function iptcc_find_chain_by_offset() searches through the chains "C" in the chain list (worst-case hitting the last one). The solution: in this patch is to speed up iptcc_find_chain_by_offset() by using binary search. Reducing complexity from O(C) to O(log C). Implementation: Its possible to use the same bsearch algorithm and data structure (chain_index), as used for chain name searching. How is that possible: One has to realize that the chains are both sorted by name and offsets, this is because the chains are already sorted in the ruleset from the kernel. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Patrick McHardy --- libiptc/libiptc.c | 123 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 112 insertions(+), 11 deletions(-) diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index ec5317bc..b68e48c3 100644 --- a/libiptc/libiptc.c +++ b/libiptc/libiptc.c @@ -140,10 +140,20 @@ STRUCT_TC_HANDLE struct chain_head **chain_index; /* array for fast chain list access*/ unsigned int chain_index_sz;/* size of chain index array */ + int sorted_offsets; /* if chains are received sorted from kernel, + * then the offsets are also sorted. Says if its + * possible to bsearch offsets using chain_index. + */ + STRUCT_GETINFO info; STRUCT_GET_ENTRIES *entries; }; +enum bsearch_type { + BSEARCH_NAME, /* Binary search after chain name */ + BSEARCH_OFFSET, /* Binary search based on offset */ +}; + /* allocate a new chain head for the cache */ static struct chain_head *iptcc_alloc_chain_head(const char *name, int hooknum) { @@ -306,15 +316,21 @@ iptcb_ent_is_hook_entry(STRUCT_ENTRY *e, TC_HANDLE_T h) static inline unsigned int iptcc_is_builtin(struct chain_head *c); - /* Use binary search in the chain index array, to find a chain_head * pointer closest to the place of the searched name element. * * Notes that, binary search (obviously) requires that the chain list * is sorted by name. + * + * The not so obvious: The chain index array, is actually both sorted + * by name and offset, at the same time!. This is only true because, + * chain are stored sorted in the kernel (as we pushed it in sorted). + * */ static struct list_head * -iptcc_bsearch_chain_index(const char *name, unsigned int *idx, TC_HANDLE_T handle) +__iptcc_bsearch_chain_index(const char *name, unsigned int offset, + unsigned int *idx, TC_HANDLE_T handle, + enum bsearch_type type) { unsigned int pos, end; int res; @@ -332,7 +348,8 @@ iptcc_bsearch_chain_index(const char *name, unsigned int *idx, TC_HANDLE_T handl end = handle->chain_index_sz; pos = end / 2; - debug("bsearch Find chain:%s (pos:%d end:%d)\n", name, pos, end); + debug("bsearch Find chain:%s (pos:%d end:%d) (offset:%d)\n", + name, pos, end, offset); /* Loop */ loop: @@ -341,13 +358,32 @@ iptcc_bsearch_chain_index(const char *name, unsigned int *idx, TC_HANDLE_T handl return &handle->chains; /* Be safe, return orig start pos */ } - res = strcmp(name, handle->chain_index[pos]->name); + debug("bsearch Index[%d] name:%s ", + pos, handle->chain_index[pos]->name); + + /* Support for different compare functions */ + switch (type) { + case BSEARCH_NAME: + res = strcmp(name, handle->chain_index[pos]->name); + break; + case BSEARCH_OFFSET: + debug("head_offset:[%d] foot_offset:[%d] ", + handle->chain_index[pos]->head_offset, + handle->chain_index[pos]->foot_offset); + res = offset - handle->chain_index[pos]->head_offset; + break; + default: + fprintf(stderr, "ERROR: %d not a valid bsearch type\n", + type); + abort(); + break; + } + debug("res:%d ", res); + + list_pos = &handle->chain_index[pos]->list; *idx = pos; - debug("bsearch Index[%d] name:%s res:%d ", - pos, handle->chain_index[pos]->name, res); - if (res == 0) { /* Found element, by direct hit */ debug("[found] Direct hit pos:%d end:%d\n", pos, end); return list_pos; @@ -371,7 +407,15 @@ iptcc_bsearch_chain_index(const char *name, unsigned int *idx, TC_HANDLE_T handl } /* Exit case: Next index less, thus elem in this list section */ - res = strcmp(name, handle->chain_index[pos+1]->name); + switch (type) { + case BSEARCH_NAME: + res = strcmp(name, handle->chain_index[pos+1]->name); + break; + case BSEARCH_OFFSET: + res = offset - handle->chain_index[pos+1]->head_offset; + break; + } + if (res < 0) { debug("[found] closest list (end:%d)\n", end); return list_pos; @@ -385,6 +429,34 @@ iptcc_bsearch_chain_index(const char *name, unsigned int *idx, TC_HANDLE_T handl return list_pos; } +/* Wrapper for string chain name based bsearch */ +static struct list_head * +iptcc_bsearch_chain_index(const char *name, unsigned int *idx, + TC_HANDLE_T handle) +{ + return __iptcc_bsearch_chain_index(name, 0, idx, handle, BSEARCH_NAME); +} + + +/* Wrapper for offset chain based bsearch */ +static struct list_head * +iptcc_bsearch_chain_offset(unsigned int offset, unsigned int *idx, + TC_HANDLE_T handle) +{ + struct list_head *pos; + + /* If chains were not received sorted from kernel, then the + * offset bsearch is not possible. + */ + if (!handle->sorted_offsets) + pos = handle->chains.next; + else + pos = __iptcc_bsearch_chain_index(NULL, offset, idx, handle, + BSEARCH_OFFSET); + return pos; +} + + #ifdef DEBUG /* Trivial linear search of chain index. Function used for verifying the output of bsearch function */ @@ -612,14 +684,28 @@ static struct chain_head * iptcc_find_chain_by_offset(TC_HANDLE_T handle, unsigned int offset) { struct list_head *pos; + struct list_head *list_start_pos; + unsigned int i; if (list_empty(&handle->chains)) return NULL; - list_for_each(pos, &handle->chains) { + /* Find a smart place to start the search */ + list_start_pos = iptcc_bsearch_chain_offset(offset, &i, handle); + + /* Note that iptcc_bsearch_chain_offset() skips builtin + * chains, but this function is only used for finding jump + * targets, and a buildin chain is not a valid jump target */ + + debug("Offset:[%u] starting search at index:[%u]\n", offset, i); +// list_for_each(pos, &handle->chains) { + list_for_each(pos, list_start_pos->prev) { struct chain_head *c = list_entry(pos, struct chain_head, list); - if (offset >= c->head_offset && offset <= c->foot_offset) + debug("."); + if (offset >= c->head_offset && offset <= c->foot_offset) { + debug("Offset search found chain:[%s]\n", c->name); return c; + } } return NULL; @@ -819,11 +905,22 @@ static void __iptcc_p_add_chain(TC_HANDLE_T h, struct chain_head *c, list_add_tail(&c->list, &h->chains); else { ctail = list_entry(tail, struct chain_head, list); + if (strcmp(c->name, ctail->name) > 0 || iptcc_is_builtin(ctail)) list_add_tail(&c->list, &h->chains);/* Already sorted*/ - else + else { iptc_insert_chain(h, c);/* Was not sorted */ + + /* Notice, if chains were not received sorted + * from kernel, then an offset bsearch is no + * longer valid. + */ + h->sorted_offsets = 0; + + debug("NOTICE: chain:[%s] was NOT sorted(ctail:%s)\n", + c->name, ctail->name); + } } h->chain_iterator_cur = c; @@ -947,6 +1044,10 @@ static int parse_table(TC_HANDLE_T h) unsigned int num = 0; struct chain_head *c; + /* Assume that chains offsets are sorted, this verified during + parsing of ruleset (in __iptcc_p_add_chain())*/ + h->sorted_offsets = 1; + /* First pass: over ruleset blob */ ENTRY_ITERATE(h->entries->entrytable, h->entries->size, cache_add_entry, h, &prev, &num); -- cgit v1.2.3 From 78d2d14211466f1986882ba6bdf82e6429ce78dc Mon Sep 17 00:00:00 2001 From: Joonwoo Park Date: Mon, 7 Jul 2008 13:32:25 +0200 Subject: xt_string: string extension case insensitive matching The string extension can search patterns case insensitively with --icase option. A new revision 1 was added, in the meantime invert of xt_string_info was moved into flags as a flag. Signed-off-by: Joonwoo Park Signed-off-by: Patrick McHardy --- extensions/libxt_string.c | 70 +++++++++++++++++++++++++++++++------ include/linux/netfilter/xt_string.h | 15 +++++++- 2 files changed, 74 insertions(+), 11 deletions(-) diff --git a/extensions/libxt_string.c b/extensions/libxt_string.c index 5eec44ba..61b5bb56 100644 --- a/extensions/libxt_string.c +++ b/extensions/libxt_string.c @@ -37,7 +37,8 @@ static void string_help(void) "string match options:\n" "--from Offset to start searching from\n" "--to Offset to stop searching\n" -"--algo Algorithm\n" +"--algo Algorithm\n" +"--icase Ignore case (default: 0)\n" "[!] --string string Match a string in a packet\n" "[!] --hex-string string Match a hex string in a packet\n"); } @@ -48,6 +49,7 @@ static const struct option string_opts[] = { { "algo", 1, NULL, '3' }, { "string", 1, NULL, '4' }, { "hex-string", 1, NULL, '5' }, + { "icase", 0, NULL, '6' }, { .name = NULL } }; @@ -162,6 +164,7 @@ parse_hex_string(const char *s, struct xt_string_info *info) #define ALGO 0x2 #define FROM 0x4 #define TO 0x8 +#define ICASE 0x10 /* Function which parses command options; returns true if it ate an option */ @@ -169,7 +172,9 @@ static int string_parse(int c, char **argv, int invert, unsigned int *flags, const void *entry, struct xt_entry_match **match) { - struct xt_string_info *stringinfo = (struct xt_string_info *)(*match)->data; + struct xt_string_info *stringinfo = + (struct xt_string_info *)(*match)->data; + const int revision = (*match)->u.user.revision; switch (c) { case '1': @@ -199,8 +204,12 @@ string_parse(int c, char **argv, int invert, unsigned int *flags, "Can't specify multiple --string"); check_inverse(optarg, &invert, &optind, 0); parse_string(argv[optind-1], stringinfo); - if (invert) - stringinfo->invert = 1; + if (invert) { + if (revision == 0) + stringinfo->u.v0.invert = 1; + else + stringinfo->u.v1.flags |= XT_STRING_FLAG_INVERT; + } stringinfo->patlen=strlen((char *)&stringinfo->pattern); *flags |= STRING; break; @@ -212,11 +221,24 @@ string_parse(int c, char **argv, int invert, unsigned int *flags, check_inverse(optarg, &invert, &optind, 0); parse_hex_string(argv[optind-1], stringinfo); /* sets length */ - if (invert) - stringinfo->invert = 1; + if (invert) { + if (revision == 0) + stringinfo->u.v0.invert = 1; + else + stringinfo->u.v1.flags |= XT_STRING_FLAG_INVERT; + } *flags |= STRING; break; + case '6': + if (revision == 0) + exit_error(VERSION_PROBLEM, + "Kernel doesn't support --icase"); + + stringinfo->u.v1.flags |= XT_STRING_FLAG_IGNORECASE; + *flags |= ICASE; + break; + default: return 0; } @@ -287,12 +309,15 @@ string_print(const void *ip, const struct xt_entry_match *match, int numeric) { const struct xt_string_info *info = (const struct xt_string_info*) match->data; + const int revision = match->u.user.revision; + int invert = (revision == 0 ? info->u.v0.invert : + info->u.v1.flags & XT_STRING_FLAG_INVERT); if (is_hex_string(info->pattern, info->patlen)) { - printf("STRING match %s", (info->invert) ? "!" : ""); + printf("STRING match %s", invert ? "!" : ""); print_hex_string(info->pattern, info->patlen); } else { - printf("STRING match %s", (info->invert) ? "!" : ""); + printf("STRING match %s", invert ? "!" : ""); print_string(info->pattern, info->patlen); } printf("ALGO name %s ", info->algo); @@ -300,6 +325,8 @@ string_print(const void *ip, const struct xt_entry_match *match, int numeric) printf("FROM %u ", info->from_offset); if (info->to_offset != 0) printf("TO %u ", info->to_offset); + if (revision > 0 && info->u.v1.flags & XT_STRING_FLAG_IGNORECASE) + printf("ICASE "); } @@ -308,12 +335,15 @@ static void string_save(const void *ip, const struct xt_entry_match *match) { const struct xt_string_info *info = (const struct xt_string_info*) match->data; + const int revision = match->u.user.revision; + int invert = (revision == 0 ? info->u.v0.invert : + info->u.v1.flags & XT_STRING_FLAG_INVERT); if (is_hex_string(info->pattern, info->patlen)) { - printf("--hex-string %s", (info->invert) ? "! ": ""); + printf("--hex-string %s", (invert) ? "! ": ""); print_hex_string(info->pattern, info->patlen); } else { - printf("--string %s", (info->invert) ? "! ": ""); + printf("--string %s", (invert) ? "! ": ""); print_string(info->pattern, info->patlen); } printf("--algo %s ", info->algo); @@ -321,11 +351,30 @@ static void string_save(const void *ip, const struct xt_entry_match *match) printf("--from %u ", info->from_offset); if (info->to_offset != 0) printf("--to %u ", info->to_offset); + if (revision > 0 && info->u.v1.flags & XT_STRING_FLAG_IGNORECASE) + printf("--icase "); } static struct xtables_match string_match = { .name = "string", + .revision = 0, + .family = AF_UNSPEC, + .version = XTABLES_VERSION, + .size = XT_ALIGN(sizeof(struct xt_string_info)), + .userspacesize = offsetof(struct xt_string_info, config), + .help = string_help, + .init = string_init, + .parse = string_parse, + .final_check = string_check, + .print = string_print, + .save = string_save, + .extra_opts = string_opts, +}; + +static struct xtables_match string_match_v1 = { + .name = "string", + .revision = 1, .family = AF_UNSPEC, .version = XTABLES_VERSION, .size = XT_ALIGN(sizeof(struct xt_string_info)), @@ -342,4 +391,5 @@ static struct xtables_match string_match = { void _init(void) { xtables_register_match(&string_match); + xtables_register_match(&string_match_v1); } diff --git a/include/linux/netfilter/xt_string.h b/include/linux/netfilter/xt_string.h index bb21dd1a..f1c182fd 100644 --- a/include/linux/netfilter/xt_string.h +++ b/include/linux/netfilter/xt_string.h @@ -4,6 +4,11 @@ #define XT_STRING_MAX_PATTERN_SIZE 128 #define XT_STRING_MAX_ALGO_NAME_SIZE 16 +enum { + XT_STRING_FLAG_INVERT = 0x01, + XT_STRING_FLAG_IGNORECASE = 0x02 +}; + struct xt_string_info { u_int16_t from_offset; @@ -11,7 +16,15 @@ struct xt_string_info char algo[XT_STRING_MAX_ALGO_NAME_SIZE]; char pattern[XT_STRING_MAX_PATTERN_SIZE]; u_int8_t patlen; - u_int8_t invert; + union { + struct { + u_int8_t invert; + } v0; + + struct { + u_int8_t flags; + } v1; + } u; /* Used internally by the kernel */ struct ts_config __attribute__((aligned(8))) *config; -- cgit v1.2.3 From 675e30f258952292972a562b71161b6d3cd77313 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Wed, 23 Jul 2008 15:03:28 +0200 Subject: v1.4.2-rc1 --- configure.ac | 4 ++-- release.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 09e5d0d4..2ffe6c02 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ define([_XTABLES_VERSION_MAJOR], 1) define([_XTABLES_VERSION_MINOR], 4) -define([_XTABLES_VERSION_PATCH], 1) -define([_XTABLES_VERSION_EXTRA], .1) +define([_XTABLES_VERSION_PATCH], 2) +define([_XTABLES_VERSION_EXTRA], -rc1) define([_XTABLES_VERSION],_XTABLES_VERSION_MAJOR._XTABLES_VERSION_MINOR._XTABLES_VERSION_PATCH[]_XTABLES_VERSION_EXTRA) diff --git a/release.sh b/release.sh index 526fb953..30f3931e 100644 --- a/release.sh +++ b/release.sh @@ -2,8 +2,8 @@ # set -e -VERSION=1.4.1.1 -PREV_VERSION=1.4.1 +VERSION=1.4.2-rc1 +PREV_VERSION=1.4.1.1 TMPDIR=/tmp/ipt-release IPTDIR="$TMPDIR/iptables-$VERSION" -- cgit v1.2.3