From 3897b008281888f7905cc1857ccb316cdf686061 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 30 Aug 2019 11:47:42 +0200 Subject: nft: Introduce nft_bridge_commit() No need to check family value from nft_commit() if we can have a dedicated callback for bridge family. Signed-off-by: Phil Sutter Acked-by: Pablo Neira Ayuso --- iptables/nft.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'iptables/nft.c') diff --git a/iptables/nft.c b/iptables/nft.c index 81d01310..77ebc4f6 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -3069,11 +3069,15 @@ static void nft_bridge_commit_prepare(struct nft_handle *h) int nft_commit(struct nft_handle *h) { - if (h->family == NFPROTO_BRIDGE) - nft_bridge_commit_prepare(h); return nft_action(h, NFT_COMPAT_COMMIT); } +int nft_bridge_commit(struct nft_handle *h) +{ + nft_bridge_commit_prepare(h); + return nft_commit(h); +} + int nft_abort(struct nft_handle *h) { return nft_action(h, NFT_COMPAT_ABORT); -- cgit v1.2.3