]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
option: remove last traces of intrapositional negation
authorJan Engelhardt <jengelh@medozas.de>
Sat, 9 Jul 2011 17:37:31 +0000 (19:37 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sun, 10 Jul 2011 09:51:10 +0000 (11:51 +0200)
Intrapositional negation was deprecated in 1.4.3.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
extensions/libxt_SET.c
extensions/libxt_rateest.c
extensions/libxt_sctp.c
extensions/libxt_set.c
extensions/libxt_tcp.c
include/xtables.h.in
iptables/ip6tables.c
iptables/iptables.c
iptables/xtables.c

index 51c0cec6e0a1e568e38e8ecfc3285fa2d8682a17..04466037362a31d1145cc6e6f06911288337dcdf 100644 (file)
@@ -67,10 +67,6 @@ parse_target_v0(char **argv, int invert, unsigned int *flags,
                xtables_error(PARAMETER_PROBLEM,
                              "--%s can be specified only once", what);
 
-       if (xtables_check_inverse(optarg, &invert, NULL, 0, argv))
-               xtables_error(PARAMETER_PROBLEM,
-                             "Unexpected `!' after --%s", what);
-
        if (!argv[optind]
            || argv[optind][0] == '-' || argv[optind][0] == '!')
                xtables_error(PARAMETER_PROBLEM,
@@ -173,11 +169,6 @@ parse_target(char **argv, int invert, struct xt_set_info *info,
        if (info->dim)
                xtables_error(PARAMETER_PROBLEM,
                              "--%s can be specified only once", what);
-
-       if (xtables_check_inverse(optarg, &invert, NULL, 0, argv))
-               xtables_error(PARAMETER_PROBLEM,
-                             "Unexpected `!' after --%s", what);
-
        if (!argv[optind]
            || argv[optind][0] == '-' || argv[optind][0] == '!')
                xtables_error(PARAMETER_PROBLEM,
index 5f42a13717c761723dd5224c7b15c104de1fcea8..86bbb06f484f1e8cbaa941006812b7acf14875ee 100644 (file)
@@ -114,7 +114,6 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case OPT_RATEEST1:
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                if (invert)
                        xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest can't be inverted");
@@ -128,7 +127,6 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST2:
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                if (invert)
                        xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest can't be inverted");
@@ -143,7 +141,6 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_BPS1:
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                if (invert)
                        xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-bps can't be inverted");
@@ -167,7 +164,6 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_PPS1:
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                if (invert)
                        xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-pps can't be inverted");
@@ -192,7 +188,6 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_BPS2:
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                if (invert)
                        xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-bps can't be inverted");
@@ -216,7 +211,6 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_PPS2:
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                if (invert)
                        xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-pps can't be inverted");
@@ -241,7 +235,6 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_DELTA:
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                if (invert)
                        xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-delta can't be inverted");
@@ -255,8 +248,6 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_EQ:
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
-
                if (*flags & (1 << c))
                        xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify lt/gt/eq twice");
@@ -268,8 +259,6 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_LT:
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
-
                if (*flags & (1 << c))
                        xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify lt/gt/eq twice");
@@ -281,8 +270,6 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_GT:
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
-
                if (*flags & (1 << c))
                        xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify lt/gt/eq twice");
index 5dbc36f519141631161fca866cb78553052304ae..56a4cdf22939092257d034680e1633e3ceccb0e4 100644 (file)
@@ -257,7 +257,6 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags,
                        xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--source-port' allowed");
                einfo->flags |= XT_SCTP_SRC_PORTS;
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                parse_sctp_ports(optarg, einfo->spts);
                if (invert)
                        einfo->invflags |= XT_SCTP_SRC_PORTS;
@@ -269,7 +268,6 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags,
                        xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--destination-port' allowed");
                einfo->flags |= XT_SCTP_DEST_PORTS;
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                parse_sctp_ports(optarg, einfo->dpts);
                if (invert)
                        einfo->invflags |= XT_SCTP_DEST_PORTS;
@@ -280,8 +278,6 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & XT_SCTP_CHUNK_TYPES)
                        xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--chunk-types' allowed");
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
-
                if (!argv[optind] 
                    || argv[optind][0] == '-' || argv[optind][0] == '!')
                        xtables_error(PARAMETER_PROBLEM,
index da722c738ddf8a1cb45b6495bcca2a7f1859149f..6b39147e920171c391edfe1d2ba6f3919360b8db 100644 (file)
@@ -64,8 +64,6 @@ set_parse_v0(int c, char **argv, int invert, unsigned int *flags,
                if (info->u.flags[0])
                        xtables_error(PARAMETER_PROBLEM,
                                      "--match-set can be specified only once");
-
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                if (invert)
                        info->u.flags[0] |= IPSET_MATCH_INV;
 
@@ -151,8 +149,6 @@ set_parse_v1(int c, char **argv, int invert, unsigned int *flags,
                if (info->dim)
                        xtables_error(PARAMETER_PROBLEM,
                                      "--match-set can be specified only once");
-
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                if (invert)
                        info->flags |= IPSET_INV_MATCH;
 
index 4d914e39a1feb55592563dcbe211a5396b5a633b..3940d91ecfa7583171047ce7dec08a67135ad2bc 100644 (file)
@@ -148,7 +148,6 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & TCP_SRC_PORTS)
                        xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--source-port' allowed");
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                parse_tcp_ports(optarg, tcpinfo->spts);
                if (invert)
                        tcpinfo->invflags |= XT_TCP_INV_SRCPT;
@@ -159,7 +158,6 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & TCP_DST_PORTS)
                        xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--destination-port' allowed");
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                parse_tcp_ports(optarg, tcpinfo->dpts);
                if (invert)
                        tcpinfo->invflags |= XT_TCP_INV_DSTPT;
@@ -180,8 +178,6 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
                        xtables_error(PARAMETER_PROBLEM,
                                   "Only one of `--syn' or `--tcp-flags' "
                                   " allowed");
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
-
                if (!argv[optind]
                    || argv[optind][0] == '-' || argv[optind][0] == '!')
                        xtables_error(PARAMETER_PROBLEM,
@@ -197,7 +193,6 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & TCP_OPTION)
                        xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--tcp-option' allowed");
-               xtables_check_inverse(optarg, &invert, &optind, 0, argv);
                parse_tcp_option(optarg, &tcpinfo->option);
                if (invert)
                        tcpinfo->invflags |= XT_TCP_INV_OPTION;
index 0dead26804902f5c39d1a2748f2e24f3756a220e..d50df79a9f41b0ece12c7f04d909d92229ee67f9 100644 (file)
@@ -432,8 +432,6 @@ xtables_parse_interface(const char *arg, char *vianame, unsigned char *mask);
 /* this is a special 64bit data type that is 8-byte aligned */
 #define aligned_u64 u_int64_t __attribute__((aligned(8)))
 
-int xtables_check_inverse(const char option[], int *invert,
-       int *my_optind, int argc, char **argv);
 extern struct xtables_globals *xt_params;
 #define xtables_error (xt_params->exit_err)
 
index d13744ca20fba8cdf3f2290e70381bd8dc6633f0..04e5224f3929727e3c534a85f4f98c5595ca68eb 100644 (file)
@@ -1536,7 +1536,6 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                         * Option selection
                         */
                case 'p':
-                       xtables_check_inverse(optarg, &cs.invert, &optind, argc, argv);
                        set_option(&cs.options, OPT_PROTOCOL, &cs.fw6.ipv6.invflags,
                                   cs.invert);
 
@@ -1562,14 +1561,12 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                        break;
 
                case 's':
-                       xtables_check_inverse(optarg, &cs.invert, &optind, argc, argv);
                        set_option(&cs.options, OPT_SOURCE, &cs.fw6.ipv6.invflags,
                                   cs.invert);
                        shostnetworkmask = optarg;
                        break;
 
                case 'd':
-                       xtables_check_inverse(optarg, &cs.invert, &optind, argc, argv);
                        set_option(&cs.options, OPT_DESTINATION, &cs.fw6.ipv6.invflags,
                                   cs.invert);
                        dhostnetworkmask = optarg;
@@ -1594,7 +1591,6 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                                xtables_error(PARAMETER_PROBLEM,
                                        "Empty interface is likely to be "
                                        "undesired");
-                       xtables_check_inverse(optarg, &cs.invert, &optind, argc, argv);
                        set_option(&cs.options, OPT_VIANAMEIN, &cs.fw6.ipv6.invflags,
                                   cs.invert);
                        xtables_parse_interface(optarg,
@@ -1607,7 +1603,6 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                                xtables_error(PARAMETER_PROBLEM,
                                        "Empty interface is likely to be "
                                        "undesired");
-                       xtables_check_inverse(optarg, &cs.invert, &optind, argc, argv);
                        set_option(&cs.options, OPT_VIANAMEOUT, &cs.fw6.ipv6.invflags,
                                   cs.invert);
                        xtables_parse_interface(optarg,
index 6ceaf6b894513bb6529a8c5d90a4785f84def89d..50dc1e7a03895f26c646be6dc47f80c9e14a132c 100644 (file)
@@ -1566,7 +1566,6 @@ int do_command4(int argc, char *argv[], char **table, struct iptc_handle **handl
                         * Option selection
                         */
                case 'p':
-                       xtables_check_inverse(optarg, &cs.invert, &optind, argc, argv);
                        set_option(&cs.options, OPT_PROTOCOL, &cs.fw.ip.invflags,
                                   cs.invert);
 
@@ -1584,14 +1583,12 @@ int do_command4(int argc, char *argv[], char **table, struct iptc_handle **handl
                        break;
 
                case 's':
-                       xtables_check_inverse(optarg, &cs.invert, &optind, argc, argv);
                        set_option(&cs.options, OPT_SOURCE, &cs.fw.ip.invflags,
                                   cs.invert);
                        shostnetworkmask = optarg;
                        break;
 
                case 'd':
-                       xtables_check_inverse(optarg, &cs.invert, &optind, argc, argv);
                        set_option(&cs.options, OPT_DESTINATION, &cs.fw.ip.invflags,
                                   cs.invert);
                        dhostnetworkmask = optarg;
@@ -1616,7 +1613,6 @@ int do_command4(int argc, char *argv[], char **table, struct iptc_handle **handl
                                xtables_error(PARAMETER_PROBLEM,
                                        "Empty interface is likely to be "
                                        "undesired");
-                       xtables_check_inverse(optarg, &cs.invert, &optind, argc, argv);
                        set_option(&cs.options, OPT_VIANAMEIN, &cs.fw.ip.invflags,
                                   cs.invert);
                        xtables_parse_interface(optarg,
@@ -1629,7 +1625,6 @@ int do_command4(int argc, char *argv[], char **table, struct iptc_handle **handl
                                xtables_error(PARAMETER_PROBLEM,
                                        "Empty interface is likely to be "
                                        "undesired");
-                       xtables_check_inverse(optarg, &cs.invert, &optind, argc, argv);
                        set_option(&cs.options, OPT_VIANAMEOUT, &cs.fw.ip.invflags,
                                   cs.invert);
                        xtables_parse_interface(optarg,
index 0f02592036b3a708c3e41adf2513091f4a84bacc..b05df97b1a5cc23ddc266d7ac2783e811668baf2 100644 (file)
@@ -1765,35 +1765,6 @@ void xtables_save_string(const char *value)
        }
 }
 
-/**
- * Check for option-intrapositional negation.
- * Do not use in new code.
- */
-int xtables_check_inverse(const char option[], int *invert,
-                         int *my_optind, int argc, char **argv)
-{
-       if (option == NULL || strcmp(option, "!") != 0)
-               return false;
-
-       fprintf(stderr, "Using intrapositioned negation "
-               "(`--option ! this`) is deprecated in favor of "
-               "extrapositioned (`! --option this`).\n");
-
-       if (*invert)
-               xt_params->exit_err(PARAMETER_PROBLEM,
-                          "Multiple `!' flags not allowed");
-       *invert = true;
-       if (my_optind != NULL) {
-               optarg = argv[*my_optind];
-               ++*my_optind;
-               if (argc && *my_optind > argc)
-                       xt_params->exit_err(PARAMETER_PROBLEM,
-                                  "no argument following `!'");
-       }
-
-       return true;
-}
-
 const struct xtables_pprot xtables_chain_protos[] = {
        {"tcp",       IPPROTO_TCP},
        {"sctp",      IPPROTO_SCTP},