diff options
author | Phil Sutter <phil@nwl.cc> | 2019-02-12 23:44:46 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-02-13 18:19:07 +0100 |
commit | 9b477e07e00bc2d651784d7c82c2123f0bd7386b (patch) | |
tree | f851c8decdc61b09ab3cace66fb95c50da980d6b | |
parent | 764a435c26e29900921ad5cdbd160a466c3c7416 (diff) |
nfct: Drop dead code in nfct_timeout_parse_params()
Due to the first switch() in that function, default case in second one
is unreachable. Given that both of them contain the same cases but the
first one merely acts as an invalid command barrier (adding no value to
the second one), drop the first one to make invalid commands actually
hit default case in the second switch().
Fixes: dd73ceecdbe87 ("nfct: Update syntax to specify command before subsystem")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/nfct-extensions/timeout.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/nfct-extensions/timeout.c b/src/nfct-extensions/timeout.c index 30f9464..31e91a6 100644 --- a/src/nfct-extensions/timeout.c +++ b/src/nfct-extensions/timeout.c @@ -56,20 +56,6 @@ nfct_timeout_parse_params(struct mnl_socket *nl, int argc, char *argv[], int cmd switch (cmd) { case NFCT_CMD_LIST: - case NFCT_CMD_ADD: - case NFCT_CMD_DELETE: - case NFCT_CMD_GET: - case NFCT_CMD_FLUSH: - case NFCT_CMD_DEFAULT_SET: - case NFCT_CMD_DEFAULT_GET: - break; - default: - nfct_cmd_timeout_usage(argv); - return -1; - } - - switch (cmd) { - case NFCT_CMD_LIST: ret = nfct_cmd_timeout_list(nl, argc, argv); break; case NFCT_CMD_ADD: |