From f40ce2d853591220f16c0851bf8665e6967af1f1 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 19 Sep 2018 15:17:03 +0200 Subject: extensions: libebt_ip{, 6}: Drop pointless error checking 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 Signed-off-by: Florian Westphal --- extensions/libebt_ip.c | 4 ---- extensions/libebt_ip6.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/extensions/libebt_ip.c b/extensions/libebt_ip.c index 4b5c1665..2b28c615 100644 --- a/extensions/libebt_ip.c +++ b/extensions/libebt_ip.c @@ -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: diff --git a/extensions/libebt_ip6.c b/extensions/libebt_ip6.c index 4c60570e..ab1413ba 100644 --- a/extensions/libebt_ip6.c +++ b/extensions/libebt_ip6.c @@ -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: -- cgit v1.2.3