]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
DNAT: fix incorrect check during parsing
authorPatrick McHardy <kaber@trash.net>
Fri, 6 Nov 2009 16:15:07 +0000 (17:15 +0100)
committerPatrick McHardy <kaber@trash.net>
Fri, 6 Nov 2009 16:15:07 +0000 (17:15 +0100)
Specifying --random before --to-dest results in:

Multiple --to-destination not supported

Fix the flags check to only test the IPT_DNAT_OPT_DEST bit.

Signed-off-by: Patrick McHardy <kaber@trash.net>
extensions/libipt_DNAT.c

index 380294af2ff69cf38fd31f2dc54cff257e3867d1..57c5888b0254c6cb346665f4c40b5057dafd7b82 100644 (file)
@@ -158,7 +158,7 @@ static int DNAT_parse(int c, char **argv, int invert, unsigned int *flags,
                        xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --to-destination");
 
-               if (*flags) {
+               if (*flags & IPT_DNAT_OPT_DEST) {
                        if (!kernel_version)
                                get_kernel_version();
                        if (kernel_version > LINUX_VERSION(2, 6, 10))