diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2010-11-28 15:42:00 +0100 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2010-11-28 15:42:00 +0100 |
commit | 2d68ae7ce6e40e3977ee11a57296cf76801ae320 (patch) | |
tree | aeae2ae82de349ae53edbd0910b46108fe584cb8 /xtables.c | |
parent | d3b2e391e3b944581e20e216af76339cc87d0590 (diff) |
iptables: do not emit orig_opts twice
This just happened to cross my eye; there was no error, but fixing
this up saves a pitfall, and some memory.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'xtables.c')
-rw-r--r-- | xtables.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -103,6 +103,10 @@ struct option *xtables_merge_options(struct option *orig_opts, memcpy(merge, orig_opts, sizeof(*mp) * num_oold); mp = merge + num_oold; + /* Since @opts also has @orig_opts already, skip the entries */ + oldopts += num_oold; + num_old -= num_oold; + /* Second, the new options */ xt_params->option_offset += 256; *option_offset = xt_params->option_offset; |