]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xshared: Drop pointless CMD_REPLACE check
authorPhil Sutter <phil@nwl.cc>
Thu, 16 Nov 2023 16:03:10 +0000 (17:03 +0100)
committerPhil Sutter <phil@nwl.cc>
Thu, 23 Nov 2023 16:59:42 +0000 (17:59 +0100)
All current users set default source and destination addresses in their
post_parse callbacks, so legacy variants are safe and nft variants don't
have this restriction anyway.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/xshared.c

index 53e72b7abb1e8c8b8a9f584af4268bb4114d4671..c4d7a266fed5e52421cf7e7912a96e08594e60b9 100644 (file)
@@ -1836,11 +1836,6 @@ void do_parse(int argc, char *argv[],
        if (p->ops->post_parse)
                p->ops->post_parse(p->command, cs, args);
 
-       if (p->command == CMD_REPLACE &&
-           (args->s.naddrs != 1 || args->d.naddrs != 1))
-               xtables_error(PARAMETER_PROBLEM, "Replacement rule does not "
-                          "specify a unique address");
-
        generic_opt_check(p->command, cs->options);
 
        if (p->chain != NULL && strlen(p->chain) >= XT_EXTENSION_MAXNAMELEN)