|
|
ef9e95 |
From 36faead4c4a8ab0a87ee766bab6a062e8610067a Mon Sep 17 00:00:00 2001
|
|
|
ef9e95 |
From: Phil Sutter <psutter@redhat.com>
|
|
|
ef9e95 |
Date: Tue, 29 Jan 2019 18:14:56 +0100
|
|
|
ef9e95 |
Subject: [PATCH] src: chain: Add missing nftnl_chain_rule_del()
|
|
|
ef9e95 |
|
|
|
ef9e95 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1666495
|
|
|
ef9e95 |
Upstream Status: libnftnl commit de5a23d26828a
|
|
|
ef9e95 |
|
|
|
ef9e95 |
commit de5a23d26828a1e1f2d3351b0414925857546496
|
|
|
ef9e95 |
Author: Phil Sutter <phil@nwl.cc>
|
|
|
ef9e95 |
Date: Sun Dec 30 17:02:13 2018 +0100
|
|
|
ef9e95 |
|
|
|
ef9e95 |
src: chain: Add missing nftnl_chain_rule_del()
|
|
|
ef9e95 |
|
|
|
ef9e95 |
Although identical to nftnl_rule_list_del(), this function adheres to
|
|
|
ef9e95 |
the common naming style of per chain rule list routines introduced
|
|
|
ef9e95 |
earlier, therefore helps with deprecating the global rule list API at a
|
|
|
ef9e95 |
later point.
|
|
|
ef9e95 |
|
|
|
ef9e95 |
Fixes: e33798478176f ("chain: Support per chain rules list")
|
|
|
ef9e95 |
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
ef9e95 |
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
ef9e95 |
---
|
|
|
ef9e95 |
include/libnftnl/chain.h | 1 +
|
|
|
ef9e95 |
src/chain.c | 6 ++++++
|
|
|
ef9e95 |
src/libnftnl.map | 1 +
|
|
|
ef9e95 |
3 files changed, 8 insertions(+)
|
|
|
ef9e95 |
|
|
|
ef9e95 |
diff --git a/include/libnftnl/chain.h b/include/libnftnl/chain.h
|
|
|
ef9e95 |
index 64e10e9..163a824 100644
|
|
|
ef9e95 |
--- a/include/libnftnl/chain.h
|
|
|
ef9e95 |
+++ b/include/libnftnl/chain.h
|
|
|
ef9e95 |
@@ -56,6 +56,7 @@ int32_t nftnl_chain_get_s32(const struct nftnl_chain *c, uint16_t attr);
|
|
|
ef9e95 |
uint64_t nftnl_chain_get_u64(const struct nftnl_chain *c, uint16_t attr);
|
|
|
ef9e95 |
|
|
|
ef9e95 |
void nftnl_chain_rule_add(struct nftnl_rule *rule, struct nftnl_chain *c);
|
|
|
ef9e95 |
+void nftnl_chain_rule_del(struct nftnl_rule *rule);
|
|
|
ef9e95 |
void nftnl_chain_rule_add_tail(struct nftnl_rule *rule, struct nftnl_chain *c);
|
|
|
ef9e95 |
void nftnl_chain_rule_insert_at(struct nftnl_rule *rule, struct nftnl_rule *pos);
|
|
|
ef9e95 |
|
|
|
ef9e95 |
diff --git a/src/chain.c b/src/chain.c
|
|
|
ef9e95 |
index ae074fd..6dc8f36 100644
|
|
|
ef9e95 |
--- a/src/chain.c
|
|
|
ef9e95 |
+++ b/src/chain.c
|
|
|
ef9e95 |
@@ -429,6 +429,12 @@ void nftnl_chain_rule_add(struct nftnl_rule *rule, struct nftnl_chain *c)
|
|
|
ef9e95 |
list_add(&rule->head, &c->rule_list);
|
|
|
ef9e95 |
}
|
|
|
ef9e95 |
|
|
|
ef9e95 |
+EXPORT_SYMBOL(nftnl_chain_rule_del);
|
|
|
ef9e95 |
+void nftnl_chain_rule_del(struct nftnl_rule *r)
|
|
|
ef9e95 |
+{
|
|
|
ef9e95 |
+ list_del(&r->head);
|
|
|
ef9e95 |
+}
|
|
|
ef9e95 |
+
|
|
|
ef9e95 |
EXPORT_SYMBOL(nftnl_chain_rule_add_tail);
|
|
|
ef9e95 |
void nftnl_chain_rule_add_tail(struct nftnl_rule *rule, struct nftnl_chain *c)
|
|
|
ef9e95 |
{
|
|
|
ef9e95 |
diff --git a/src/libnftnl.map b/src/libnftnl.map
|
|
|
ef9e95 |
index 0d3be32..0dad6a2 100644
|
|
|
ef9e95 |
--- a/src/libnftnl.map
|
|
|
ef9e95 |
+++ b/src/libnftnl.map
|
|
|
ef9e95 |
@@ -340,6 +340,7 @@ local: *;
|
|
|
ef9e95 |
LIBNFTNL_12 {
|
|
|
ef9e95 |
nftnl_chain_rule_add;
|
|
|
ef9e95 |
nftnl_chain_rule_add_tail;
|
|
|
ef9e95 |
+ nftnl_chain_rule_del;
|
|
|
ef9e95 |
nftnl_chain_rule_insert_at;
|
|
|
ef9e95 |
nftnl_rule_foreach;
|
|
|
ef9e95 |
nftnl_rule_iter_create;
|
|
|
ef9e95 |
--
|
|
|
ef9e95 |
1.8.3.1
|
|
|
ef9e95 |
|