diff options
author | Phil Sutter <phil@nwl.cc> | 2022-03-17 11:17:13 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2022-04-08 18:00:42 +0200 |
commit | 070a8626f2c01971d88bcfbcce10c914d552c9a4 (patch) | |
tree | ecc5b65bd0a39aa7cc6b8115860f6ce8c205e8da /extensions/libip6t_SNAT.c | |
parent | 08c14fa6370bdf986476477075d43b4bcc0d26aa (diff) |
Revert "libipt_[SD]NAT: avoid false error about multiple destinations specified"
This reverts commit f25b2355e889290879c8cecad3dd24ec0c384fb8.
The workaround is not needed anymore since commit 30b178b9bf11e
("extensions: *NAT: Kill multiple IPv4 range support").
While being at it, drop the same hidden flag logic from
libip6t_[SD]NAT extensions as well and just don't set XTOPT_MULTI so
guided option parser will reject multiple parameters automatically.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'extensions/libip6t_SNAT.c')
-rw-r--r-- | extensions/libip6t_SNAT.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/extensions/libip6t_SNAT.c b/extensions/libip6t_SNAT.c index 6d19614c..4fe272b2 100644 --- a/extensions/libip6t_SNAT.c +++ b/extensions/libip6t_SNAT.c @@ -20,11 +20,9 @@ enum { O_RANDOM, O_RANDOM_FULLY, O_PERSISTENT, - O_X_TO_SRC, F_TO_SRC = 1 << O_TO_SRC, F_RANDOM = 1 << O_RANDOM, F_RANDOM_FULLY = 1 << O_RANDOM_FULLY, - F_X_TO_SRC = 1 << O_X_TO_SRC, }; static void SNAT_help(void) @@ -38,7 +36,7 @@ static void SNAT_help(void) static const struct xt_option_entry SNAT_opts[] = { {.name = "to-source", .id = O_TO_SRC, .type = XTTYPE_STRING, - .flags = XTOPT_MAND | XTOPT_MULTI}, + .flags = XTOPT_MAND}, {.name = "random", .id = O_RANDOM, .type = XTTYPE_NONE}, {.name = "random-fully", .id = O_RANDOM_FULLY, .type = XTTYPE_NONE}, {.name = "persistent", .id = O_PERSISTENT, .type = XTTYPE_NONE}, @@ -163,12 +161,7 @@ static void SNAT_parse(struct xt_option_call *cb) xtables_option_parse(cb); switch (cb->entry->id) { case O_TO_SRC: - if (cb->xflags & F_X_TO_SRC) { - xtables_error(PARAMETER_PROBLEM, - "SNAT: Multiple --to-source not supported"); - } parse_to(cb->arg, portok, range); - cb->xflags |= F_X_TO_SRC; break; case O_PERSISTENT: range->flags |= NF_NAT_RANGE_PERSISTENT; |