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>
diff --git a/xtables.c b/xtables.c
index d0aa868..2137c98 100644
--- a/xtables.c
+++ b/xtables.c
@@ -103,6 +103,10 @@
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;