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@xxxxxx> --- include/libnftnl/chain.h | 1 + src/chain.c | 6 ++++++ 2 files changed, 7 insertions(+) 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) { -- 2.19.0