[iptables PATCH 22/28] extensions: libebt_ip{,6}: Drop pointless error checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 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 4b5c1665fc014..2b28c615fe47d 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 4c60570eaab73..ab1413ba9189c 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:
-- 
2.18.0




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux