summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-05-12 13:20:00 +0200
committerJan Engelhardt <jengelh@medozas.de>2011-05-12 13:20:00 +0200
commitab847dfe38529d2aa67cc8178a54d5b45af11cfa (patch)
treeede6dfa5a12c54c721f82fe4a7c66f93b1f06e87
parent15392934cf81ef85e2a1c21380c61a7a42e260d5 (diff)
libxtables: avoid running into .also checks when option not used
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>
-rw-r--r--xtoptions.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xtoptions.c b/xtoptions.c
index 8d54dd8b..9e19250b 100644
--- a/xtoptions.c
+++ b/xtoptions.c
@@ -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)