|
|
252916 |
From cf85778a263a34aa2aeee565f3e046693164a097 Mon Sep 17 00:00:00 2001
|
|
|
252916 |
From: Phil Sutter <psutter@redhat.com>
|
|
|
252916 |
Date: Thu, 13 Jan 2022 20:37:56 +0100
|
|
|
252916 |
Subject: [PATCH] netlink: remove unused parameter from
|
|
|
252916 |
netlink_gen_stmt_stateful()
|
|
|
252916 |
|
|
|
252916 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2039594
|
|
|
252916 |
Upstream Status: nftables commit 3f3e897f42965
|
|
|
252916 |
|
|
|
252916 |
commit 3f3e897f429659ff6c8387245d0d4115952a6c31
|
|
|
252916 |
Author: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
252916 |
Date: Wed Mar 11 13:02:26 2020 +0100
|
|
|
252916 |
|
|
|
252916 |
netlink: remove unused parameter from netlink_gen_stmt_stateful()
|
|
|
252916 |
|
|
|
252916 |
Remove context from netlink_gen_stmt_stateful().
|
|
|
252916 |
|
|
|
252916 |
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
252916 |
---
|
|
|
252916 |
src/netlink_linearize.c | 36 +++++++++++++-----------------------
|
|
|
252916 |
1 file changed, 13 insertions(+), 23 deletions(-)
|
|
|
252916 |
|
|
|
252916 |
diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c
|
|
|
252916 |
index 28b0e6a..f5c6116 100644
|
|
|
252916 |
--- a/src/netlink_linearize.c
|
|
|
252916 |
+++ b/src/netlink_linearize.c
|
|
|
252916 |
@@ -780,9 +780,7 @@ static void netlink_gen_objref_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
nftnl_rule_add_expr(ctx->nlr, nle);
|
|
|
252916 |
}
|
|
|
252916 |
|
|
|
252916 |
-static struct nftnl_expr *
|
|
|
252916 |
-netlink_gen_connlimit_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
- const struct stmt *stmt)
|
|
|
252916 |
+static struct nftnl_expr *netlink_gen_connlimit_stmt(const struct stmt *stmt)
|
|
|
252916 |
{
|
|
|
252916 |
struct nftnl_expr *nle;
|
|
|
252916 |
|
|
|
252916 |
@@ -795,9 +793,7 @@ netlink_gen_connlimit_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
return nle;
|
|
|
252916 |
}
|
|
|
252916 |
|
|
|
252916 |
-static struct nftnl_expr *
|
|
|
252916 |
-netlink_gen_counter_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
- const struct stmt *stmt)
|
|
|
252916 |
+static struct nftnl_expr *netlink_gen_counter_stmt(const struct stmt *stmt)
|
|
|
252916 |
{
|
|
|
252916 |
struct nftnl_expr *nle;
|
|
|
252916 |
|
|
|
252916 |
@@ -814,9 +810,7 @@ netlink_gen_counter_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
return nle;
|
|
|
252916 |
}
|
|
|
252916 |
|
|
|
252916 |
-static struct nftnl_expr *
|
|
|
252916 |
-netlink_gen_limit_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
- const struct stmt *stmt)
|
|
|
252916 |
+static struct nftnl_expr *netlink_gen_limit_stmt(const struct stmt *stmt)
|
|
|
252916 |
{
|
|
|
252916 |
struct nftnl_expr *nle;
|
|
|
252916 |
|
|
|
252916 |
@@ -832,9 +826,7 @@ netlink_gen_limit_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
return nle;
|
|
|
252916 |
}
|
|
|
252916 |
|
|
|
252916 |
-static struct nftnl_expr *
|
|
|
252916 |
-netlink_gen_quota_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
- const struct stmt *stmt)
|
|
|
252916 |
+static struct nftnl_expr *netlink_gen_quota_stmt(const struct stmt *stmt)
|
|
|
252916 |
{
|
|
|
252916 |
struct nftnl_expr *nle;
|
|
|
252916 |
|
|
|
252916 |
@@ -846,19 +838,17 @@ netlink_gen_quota_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
return nle;
|
|
|
252916 |
}
|
|
|
252916 |
|
|
|
252916 |
-static struct nftnl_expr *
|
|
|
252916 |
-netlink_gen_stmt_stateful(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
- const struct stmt *stmt)
|
|
|
252916 |
+static struct nftnl_expr *netlink_gen_stmt_stateful(const struct stmt *stmt)
|
|
|
252916 |
{
|
|
|
252916 |
switch (stmt->ops->type) {
|
|
|
252916 |
case STMT_CONNLIMIT:
|
|
|
252916 |
- return netlink_gen_connlimit_stmt(ctx, stmt);
|
|
|
252916 |
+ return netlink_gen_connlimit_stmt(stmt);
|
|
|
252916 |
case STMT_COUNTER:
|
|
|
252916 |
- return netlink_gen_counter_stmt(ctx, stmt);
|
|
|
252916 |
+ return netlink_gen_counter_stmt(stmt);
|
|
|
252916 |
case STMT_LIMIT:
|
|
|
252916 |
- return netlink_gen_limit_stmt(ctx, stmt);
|
|
|
252916 |
+ return netlink_gen_limit_stmt(stmt);
|
|
|
252916 |
case STMT_QUOTA:
|
|
|
252916 |
- return netlink_gen_quota_stmt(ctx, stmt);
|
|
|
252916 |
+ return netlink_gen_quota_stmt(stmt);
|
|
|
252916 |
default:
|
|
|
252916 |
BUG("unknown stateful statement type %s\n", stmt->ops->name);
|
|
|
252916 |
}
|
|
|
252916 |
@@ -1307,7 +1297,7 @@ static void netlink_gen_set_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
|
|
|
252916 |
if (stmt->set.stmt)
|
|
|
252916 |
nftnl_expr_set(nle, NFTNL_EXPR_DYNSET_EXPR,
|
|
|
252916 |
- netlink_gen_stmt_stateful(ctx, stmt->set.stmt), 0);
|
|
|
252916 |
+ netlink_gen_stmt_stateful(stmt->set.stmt), 0);
|
|
|
252916 |
}
|
|
|
252916 |
|
|
|
252916 |
static void netlink_gen_map_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
@@ -1337,7 +1327,7 @@ static void netlink_gen_map_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
|
|
|
252916 |
if (stmt->map.stmt)
|
|
|
252916 |
nftnl_expr_set(nle, NFTNL_EXPR_DYNSET_EXPR,
|
|
|
252916 |
- netlink_gen_stmt_stateful(ctx, stmt->map.stmt), 0);
|
|
|
252916 |
+ netlink_gen_stmt_stateful(stmt->map.stmt), 0);
|
|
|
252916 |
|
|
|
252916 |
nftnl_rule_add_expr(ctx->nlr, nle);
|
|
|
252916 |
}
|
|
|
252916 |
@@ -1369,7 +1359,7 @@ static void netlink_gen_meter_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
nftnl_expr_set_str(nle, NFTNL_EXPR_DYNSET_SET_NAME, set->handle.set.name);
|
|
|
252916 |
nftnl_expr_set_u32(nle, NFTNL_EXPR_DYNSET_SET_ID, set->handle.set_id);
|
|
|
252916 |
nftnl_expr_set(nle, NFTNL_EXPR_DYNSET_EXPR,
|
|
|
252916 |
- netlink_gen_stmt_stateful(ctx, stmt->meter.stmt), 0);
|
|
|
252916 |
+ netlink_gen_stmt_stateful(stmt->meter.stmt), 0);
|
|
|
252916 |
nftnl_rule_add_expr(ctx->nlr, nle);
|
|
|
252916 |
}
|
|
|
252916 |
|
|
|
252916 |
@@ -1415,7 +1405,7 @@ static void netlink_gen_stmt(struct netlink_linearize_ctx *ctx,
|
|
|
252916 |
case STMT_COUNTER:
|
|
|
252916 |
case STMT_LIMIT:
|
|
|
252916 |
case STMT_QUOTA:
|
|
|
252916 |
- nle = netlink_gen_stmt_stateful(ctx, stmt);
|
|
|
252916 |
+ nle = netlink_gen_stmt_stateful(stmt);
|
|
|
252916 |
nftnl_rule_add_expr(ctx->nlr, nle);
|
|
|
252916 |
break;
|
|
|
252916 |
case STMT_NOTRACK:
|
|
|
252916 |
--
|
|
|
252916 |
2.31.1
|
|
|
252916 |
|