]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
PATCH - Fix for --random option in DNAT and REDIRECT
authorTom Eastep <teastep@shorewall.net>
Thu, 15 Nov 2007 13:06:58 +0000 (13:06 +0000)
committerPatrick McHardy <kaber@trash.net>
Thu, 15 Nov 2007 13:06:58 +0000 (13:06 +0000)
The --random option produces "Unknown arg `--random'" errors with both the
DNAT and REDIRECT targets. Corrected by the attached patch.

Tom Eastep <teastep@shorewall.net>

extensions/libipt_DNAT.c
extensions/libipt_REDIRECT.c

index eaed57b311f3820a1c72e6216a96493d2f3d118e..7322a204ad29fe25d4b48f49142c7ad677842ae3 100644 (file)
@@ -178,6 +178,7 @@ static int DNAT_parse(int c, char **argv, int invert, unsigned int *flags,
                        *flags |= IPT_DNAT_OPT_RANDOM;
                } else
                        *flags |= IPT_DNAT_OPT_RANDOM;
+               return 1;
        default:
                return 0;
        }
index 077b6d88ed6a1e8b33258b44ac4aa508485aa9a7..f749dd1e362a270719e3d43c5871d905a667d4e2 100644 (file)
@@ -23,7 +23,7 @@ IPTABLES_VERSION);
 
 static const struct option REDIRECT_opts[] = {
        { "to-ports", 1, NULL, '1' },
-       { "random", 1, NULL, '2' },
+       { "random", 0, NULL, '2' },
        { }
 };