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

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