Patchwork [iptables,3/3] nft-shared: make compare_matches as public

login
register
mail settings
Submitter Giuseppe Longo
Date March 7, 2014, 7:33 p.m.
Message ID <1394220805-18021-4-git-send-email-giuseppelng@gmail.com>
Download mbox | patch
Permalink /patch/328061/
State Deferred
Headers show

Comments

Giuseppe Longo - March 7, 2014, 7:33 p.m.
This permits to compare two xtables_ebt_entry's matches reusing compare_matches.

Signed-off-by: Giuseppe Longo <giuseppelng@gmail.com>
---
 iptables/nft-shared.c | 4 ++--
 iptables/nft-shared.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
stephen hemminger - March 7, 2014, 8:28 p.m.
On Fri,  7 Mar 2014 20:33:25 +0100
Giuseppe Longo <giuseppelng@gmail.com> wrote:

> +bool compare_matches(struct xtables_rule_match *mt1,
> +		     struct xtables_rule_match *mt2)

any function exposed as global should have a name that uses
a prefix, something like nft_compare_matches or xt_compare_matches

The kernel is linked as single C application and this avoids future
name conflicts.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c
index e2bc802..d59abd4 100644
--- a/iptables/nft-shared.c
+++ b/iptables/nft-shared.c
@@ -690,8 +690,8 @@  struct nft_family_ops *nft_family_ops_lookup(int family)
 	return NULL;
 }
 
-static bool
-compare_matches(struct xtables_rule_match *mt1, struct xtables_rule_match *mt2)
+bool compare_matches(struct xtables_rule_match *mt1,
+		     struct xtables_rule_match *mt2)
 {
 	struct xtables_rule_match *mp1;
 	struct xtables_rule_match *mp2;
diff --git a/iptables/nft-shared.h b/iptables/nft-shared.h
index 145f19d..b80b7c0 100644
--- a/iptables/nft-shared.h
+++ b/iptables/nft-shared.h
@@ -128,6 +128,7 @@  struct nft_handle;
 bool nft_ipv46_rule_find(struct nft_family_ops *ops, struct nft_rule *r,
 			 struct iptables_command_state *cs);
 
+bool compare_matches(struct xtables_rule_match *mt1, struct xtables_rule_match *mt2);
 bool compare_targets(struct xtables_target *tg1, struct xtables_target *tg2);
 
 struct addr_mask {