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

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