]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: avoid running into .also checks when option not used
authorJan Engelhardt <jengelh@medozas.de>
Thu, 12 May 2011 11:20:00 +0000 (13:20 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Thu, 12 May 2011 11:20:00 +0000 (13:20 +0200)
If a particular option was not specified, it should not be subject to
.also checks in xtables_option_fcheck2 either.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
xtoptions.c

index 8d54dd8b3c1a59e3ed3513e9e7e7c2b46a6f3c9a..9e19250b624d9364e0df4723936fb6418492490c 100644 (file)
@@ -949,6 +949,9 @@ void xtables_options_fcheck(const char *name, unsigned int xflags,
                        xt_params->exit_err(PARAMETER_PROBLEM,
                                "%s: option \"--%s\" must be specified\n",
                                name, entry->name);
+               if (!(xflags & (1 << entry->id)))
+                       /* Not required, not specified, thus skip. */
+                       continue;
 
                for (i = 0; i < CHAR_BIT * sizeof(entry->id); ++i) {
                        if (entry->id == i)