diff mbox series

[libnftnl] src: chain: Add missing nftnl_chain_rule_del()

Message ID 20181230160213.19223-1-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show
Series [libnftnl] src: chain: Add missing nftnl_chain_rule_del() | expand

Commit Message

Phil Sutter Dec. 30, 2018, 4:02 p.m. UTC
Although identical to nftnl_rule_list_del(), this function adheres to
the common naming style of per chain rule list routines introduced
earlier, therefore helps with deprecating the global rule list API at a
later point.

Fixes: e33798478176f ("chain: Support per chain rules list")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 include/libnftnl/chain.h | 1 +
 src/chain.c              | 6 ++++++
 2 files changed, 7 insertions(+)

Comments

Pablo Neira Ayuso Jan. 14, 2019, 9:35 p.m. UTC | #1
On Sun, Dec 30, 2018 at 05:02:13PM +0100, Phil Sutter wrote:
> Although identical to nftnl_rule_list_del(), this function adheres to
> the common naming style of per chain rule list routines introduced
> earlier, therefore helps with deprecating the global rule list API at a
> later point.

Applied, thanks. I have also updated the .map file, that chunk is
missing.
diff mbox series

Patch

diff --git a/include/libnftnl/chain.h b/include/libnftnl/chain.h
index 64e10e91aaefe..163a824c457c2 100644
--- a/include/libnftnl/chain.h
+++ b/include/libnftnl/chain.h
@@ -56,6 +56,7 @@  int32_t nftnl_chain_get_s32(const struct nftnl_chain *c, uint16_t attr);
 uint64_t nftnl_chain_get_u64(const struct nftnl_chain *c, uint16_t attr);
 
 void nftnl_chain_rule_add(struct nftnl_rule *rule, struct nftnl_chain *c);
+void nftnl_chain_rule_del(struct nftnl_rule *rule);
 void nftnl_chain_rule_add_tail(struct nftnl_rule *rule, struct nftnl_chain *c);
 void nftnl_chain_rule_insert_at(struct nftnl_rule *rule, struct nftnl_rule *pos);
 
diff --git a/src/chain.c b/src/chain.c
index 03eeb655ae572..5f8eb5ca93e95 100644
--- a/src/chain.c
+++ b/src/chain.c
@@ -429,6 +429,12 @@  void nftnl_chain_rule_add(struct nftnl_rule *rule, struct nftnl_chain *c)
 	list_add(&rule->head, &c->rule_list);
 }
 
+EXPORT_SYMBOL(nftnl_chain_rule_del);
+void nftnl_chain_rule_del(struct nftnl_rule *r)
+{
+	list_del(&r->head);
+}
+
 EXPORT_SYMBOL(nftnl_chain_rule_add_tail);
 void nftnl_chain_rule_add_tail(struct nftnl_rule *rule, struct nftnl_chain *c)
 {