Blame SOURCES/0003-nfct-Drop-dead-code-in-nfct_timeout_parse_params.patch

0c8692
From 3a78f5f896726ef8ad08cf8f750f2bc57dd85ab5 Mon Sep 17 00:00:00 2001
0c8692
From: Phil Sutter <phil@nwl.cc>
0c8692
Date: Tue, 12 Feb 2019 23:44:46 +0100
0c8692
Subject: [PATCH] nfct: Drop dead code in nfct_timeout_parse_params()
0c8692
0c8692
Due to the first switch() in that function, default case in second one
0c8692
is unreachable. Given that both of them contain the same cases but the
0c8692
first one merely acts as an invalid command barrier (adding no value to
0c8692
the second one), drop the first one to make invalid commands actually
0c8692
hit default case in the second switch().
0c8692
0c8692
Fixes: dd73ceecdbe87 ("nfct: Update syntax to specify command before subsystem")
0c8692
Signed-off-by: Phil Sutter <phil@nwl.cc>
0c8692
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
0c8692
(cherry picked from commit 9b477e07e00bc2d651784d7c82c2123f0bd7386b)
0c8692
---
0c8692
 src/nfct-extensions/timeout.c | 14 --------------
0c8692
 1 file changed, 14 deletions(-)
0c8692
0c8692
diff --git a/src/nfct-extensions/timeout.c b/src/nfct-extensions/timeout.c
0c8692
index 30f94642bd3bd..31e91a63de722 100644
0c8692
--- a/src/nfct-extensions/timeout.c
0c8692
+++ b/src/nfct-extensions/timeout.c
0c8692
@@ -54,20 +54,6 @@ nfct_timeout_parse_params(struct mnl_socket *nl, int argc, char *argv[], int cmd
0c8692
 		return -1;
0c8692
 	}
0c8692
 
0c8692
-	switch (cmd) {
0c8692
-	case NFCT_CMD_LIST:
0c8692
-	case NFCT_CMD_ADD:
0c8692
-	case NFCT_CMD_DELETE:
0c8692
-	case NFCT_CMD_GET:
0c8692
-	case NFCT_CMD_FLUSH:
0c8692
-	case NFCT_CMD_DEFAULT_SET:
0c8692
-	case NFCT_CMD_DEFAULT_GET:
0c8692
-		break;
0c8692
-	default:
0c8692
-		nfct_cmd_timeout_usage(argv);
0c8692
-		return -1;
0c8692
-	}
0c8692
-
0c8692
 	switch (cmd) {
0c8692
 	case NFCT_CMD_LIST:
0c8692
 		ret = nfct_cmd_timeout_list(nl, argc, argv);
0c8692
-- 
0c8692
2.21.0
0c8692