Blob Blame History Raw
From ed4ceb7da31534de89df66d241d449c644fd3ec2 Mon Sep 17 00:00:00 2001
From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Tue, 16 Oct 2018 20:56:57 +0200
Subject: [PATCH] src: remove opts field from struct xt_stmt

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>
(cherry picked from commit b274c169014e71715f9333ee028c5a9304881919)
Signed-off-by: Phil Sutter <psutter@redhat.com>
---
 include/statement.h | 1 -
 src/statement.c     | 1 -
 src/xt.c            | 8 ++------
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/include/statement.h b/include/statement.h
index 5a907aa4dee48..0ddbffd24772b 100644
--- a/include/statement.h
+++ b/include/statement.h
@@ -225,7 +225,6 @@ struct xt_stmt {
 		struct xtables_match	*match;
 		struct xtables_target	*target;
 	};
-	const char			*opts;
 	void				*entry;
 };
 
diff --git a/src/statement.c b/src/statement.c
index 58e86f215d5ac..e9c9d648b0092 100644
--- a/src/statement.c
+++ b/src/statement.c
@@ -767,7 +767,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);
 }
 
diff --git a/src/xt.c b/src/xt.c
index 95d0c5f24c07e..74763d58cafd7 100644
--- 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,
-- 
2.21.0