]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
xt: Purify enum nft_xt_type
authorPhil Sutter <phil@nwl.cc>
Thu, 24 Nov 2022 15:24:05 +0000 (16:24 +0100)
committerPhil Sutter <phil@nwl.cc>
Tue, 13 Dec 2022 13:59:55 +0000 (14:59 +0100)
Remove NFT_XT_MAX from the enum, it is not a valid xt type.

Signed-off-by: Phil Sutter <phil@nwl.cc>
include/statement.h
src/xt.c

index 8651fc78892c93ed45b9b0c8e2522b567b59b266..e648fb137b7401223457789f82f5af8f5ece8580 100644 (file)
@@ -255,8 +255,8 @@ enum nft_xt_type {
        NFT_XT_MATCH = 0,
        NFT_XT_TARGET,
        NFT_XT_WATCHER,
-       NFT_XT_MAX
 };
+#define NFT_XT_MAX     (NFT_XT_WATCHER + 1)
 
 struct xtables_match;
 struct xtables_target;
index 7880fa1bc696683d8a08c9cfa8adaea375fd3b8f..300416a1e8d922de8b86deb59129dbf5cbdcbeae 100644 (file)
--- a/src/xt.c
+++ b/src/xt.c
@@ -110,8 +110,6 @@ void xt_stmt_xlate(const struct stmt *stmt, struct output_ctx *octx)
                }
                xfree(t);
                break;
-       default:
-               break;
        }
 
        xt_xlate_free(xl);