]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
extensions: libebt_ip{, 6}: Drop pointless error checking
authorPhil Sutter <phil@nwl.cc>
Wed, 19 Sep 2018 13:17:03 +0000 (15:17 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 24 Sep 2018 09:49:55 +0000 (11:49 +0200)
Since info->protocol is of type __u8, its value will never become -1.
Apart from that, xtables_parse_protocol() calls xt_params->exit_err() in
case of error, so this code is dead anyway.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
extensions/libebt_ip.c
extensions/libebt_ip6.c

index 4b5c1665fc014c4d6bf49c397ba920883ed98ecd..2b28c615fe47ded29bbfcd53b7fee1ab0aa28060 100644 (file)
@@ -437,10 +437,6 @@ brip_parse(int c, char **argv, int invert, unsigned int *flags,
                if (invert)
                        info->invflags |= EBT_IP_PROTO;
                info->protocol = xtables_parse_protocol(optarg);
-               if (info->protocol == -1)
-                       xtables_error(PARAMETER_PROBLEM,
-                                     "Unknown specified IP protocol - %s",
-                                     optarg);
                info->bitmask |= EBT_IP_PROTO;
                break;
        default:
index 4c60570eaab73fd40ea7717dc23cf7e60114abff..ab1413ba9189c565d6652211922829c4da371d2c 100644 (file)
@@ -376,10 +376,6 @@ brip6_parse(int c, char **argv, int invert, unsigned int *flags,
                if (invert)
                        info->invflags |= EBT_IP6_PROTO;
                info->protocol = xtables_parse_protocol(optarg);
-               if (info->protocol == -1)
-                       xtables_error(PARAMETER_PROBLEM,
-                                     "Unknown specified IP protocol - %s",
-                                     optarg);
                info->bitmask |= EBT_IP6_PROTO;
                break;
        default: