diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2011-08-21 10:14:28 +0200 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2011-08-21 10:27:53 +0200 |
commit | 735f3d76ccd3a7deab13703d7c227c87c666a97b (patch) | |
tree | ade61925ff6039ac03f7d2a77a51d5f6b7d65584 /iptables | |
parent | bca5b9afbe4b3823989f1e78f178203eb3bfa37d (diff) |
xtoptions: flag use of XTOPT_POINTER without XTOPT_PUT
When XTOPT_POINTER is used (and yields a non-zero offsetof), we can
flag the absence of XTOPT_PUT.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'iptables')
-rw-r--r-- | iptables/xtoptions.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/iptables/xtoptions.c b/iptables/xtoptions.c index 7095e3ea..04344af4 100644 --- a/iptables/xtoptions.c +++ b/iptables/xtoptions.c @@ -847,8 +847,14 @@ void xtables_option_metavalidate(const char *name, xt_params->exit_err(OTHER_PROBLEM, "Extension %s uses invalid ID %u\n", name, entry->id); - if (!(entry->flags & XTOPT_PUT)) + if (!(entry->flags & XTOPT_PUT)) { + if (entry->ptroff != 0) + xt_params->exit_err(OTHER_PROBLEM, + "%s: ptroff for \"--%s\" is non-" + "zero but no XTOPT_PUT is specified. " + "Oversight?", name, entry->name); continue; + } if (entry->type >= ARRAY_SIZE(xtopt_psize) || xtopt_psize[entry->type] == 0) xt_params->exit_err(OTHER_PROBLEM, |