]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
src: remove opts field from struct xt_stmt
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 16 Oct 2018 18:56:57 +0000 (20:56 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 17 Oct 2018 09:23:29 +0000 (11:23 +0200)
This is never used, ie. always NULL.

Reported-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Phil Sutter <phil@nwl.cc>
include/statement.h
src/statement.c
src/xt.c

index 48ba6673553b1d39d7c51fc33af0f0a04ffab68f..44240550507296670e3acee42919c5c354df72b1 100644 (file)
@@ -237,7 +237,6 @@ struct xt_stmt {
                struct xtables_match    *match;
                struct xtables_target   *target;
        };
-       const char                      *opts;
        void                            *entry;
 };
 
index 909f04ca382ecbb8219cc2d7a1d4e843491afd52..e50ac706402d29f12e6045085e4f736e79b242fe 100644 (file)
@@ -832,7 +832,6 @@ static void xt_stmt_print(const struct stmt *stmt, struct output_ctx *octx)
 static void xt_stmt_destroy(struct stmt *stmt)
 {
        xfree(stmt->xt.name);
-       xfree(stmt->xt.opts);
        xt_stmt_release(stmt);
 }
 
index 95d0c5f24c07e8c45f262d91009df8b144d9cb55..74763d58cafd78ce927897ff59bec11f06ca981d 100644 (file)
--- a/src/xt.c
+++ b/src/xt.c
@@ -32,9 +32,7 @@ void xt_stmt_xlate(const struct stmt *stmt)
 
        switch (stmt->xt.type) {
        case NFT_XT_MATCH:
-               if (stmt->xt.match == NULL && stmt->xt.opts) {
-                       printf("%s", stmt->xt.opts);
-               } else if (stmt->xt.match->xlate) {
+               if (stmt->xt.match->xlate) {
                        struct xt_xlate_mt_params params = {
                                .ip             = stmt->xt.entry,
                                .match          = stmt->xt.match->m,
@@ -51,9 +49,7 @@ void xt_stmt_xlate(const struct stmt *stmt)
                break;
        case NFT_XT_WATCHER:
        case NFT_XT_TARGET:
-               if (stmt->xt.target == NULL && stmt->xt.opts) {
-                       printf("%s", stmt->xt.opts);
-               } else if (stmt->xt.target->xlate) {
+               if (stmt->xt.target->xlate) {
                        struct xt_xlate_tg_params params = {
                                .ip             = stmt->xt.entry,
                                .target         = stmt->xt.target->t,