[PATCH 048/103] netfilter: ebtables: change ebt_basic_match to xt convention

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When this will become an xt_match, it needs the xt semantics;
this mandates changing the return values from 1/0 to 0/1.

Signed-off-by: Jan Engelhardt <jengelh@xxxxxxxxxx>
---
 net/bridge/netfilter/ebtables.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index df68825..9f871e4 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -101,7 +101,7 @@ ebt_dev_check(const char *entry, const struct net_device *device)
 
 #define FWINV2(bool,invflg) ((bool) ^ !!(e->invflags & invflg))
 /* process standard matches */
-static inline int
+static inline bool
 ebt_basic_match(const struct ebt_entry *e, const struct ethhdr *h,
                 const struct net_device *in, const struct net_device *out)
 {
@@ -109,21 +109,21 @@ ebt_basic_match(const struct ebt_entry *e, const struct ethhdr *h,
 
 	if (e->bitmask & EBT_802_3) {
 		if (FWINV2(ntohs(h->h_proto) >= 1536, EBT_IPROTO))
-			return 1;
+			return false;
 	} else if (!(e->bitmask & EBT_NOPROTO) &&
 	   FWINV2(e->ethproto != h->h_proto, EBT_IPROTO))
-		return 1;
+		return false;
 
 	if (FWINV2(ebt_dev_check(e->in, in), EBT_IIN))
-		return 1;
+		return false;
 	if (FWINV2(ebt_dev_check(e->out, out), EBT_IOUT))
-		return 1;
+		return false;
 	if ((!in || !in->br_port) ? 0 : FWINV2(ebt_dev_check(
 	   e->logical_in, in->br_port->br->dev), EBT_ILOGICALIN))
-		return 1;
+		return false;
 	if ((!out || !out->br_port) ? 0 : FWINV2(ebt_dev_check(
 	   e->logical_out, out->br_port->br->dev), EBT_ILOGICALOUT))
-		return 1;
+		return false;
 
 	if (e->bitmask & EBT_SOURCEMAC) {
 		verdict = 0;
@@ -131,7 +131,7 @@ ebt_basic_match(const struct ebt_entry *e, const struct ethhdr *h,
 			verdict |= (h->h_source[i] ^ e->sourcemac[i]) &
 			   e->sourcemsk[i];
 		if (FWINV2(verdict != 0, EBT_ISOURCE) )
-			return 1;
+			return false;
 	}
 	if (e->bitmask & EBT_DESTMAC) {
 		verdict = 0;
@@ -139,9 +139,9 @@ ebt_basic_match(const struct ebt_entry *e, const struct ethhdr *h,
 			verdict |= (h->h_dest[i] ^ e->destmac[i]) &
 			   e->destmsk[i];
 		if (FWINV2(verdict != 0, EBT_IDEST) )
-			return 1;
+			return false;
 	}
-	return 0;
+	return true;
 }
 
 static inline __pure
@@ -188,7 +188,7 @@ unsigned int ebt_do_table (unsigned int hook, struct sk_buff *skb,
 	base = private->entries;
 	i = 0;
 	while (i < nentries) {
-		if (ebt_basic_match(point, eth_hdr(skb), in, out))
+		if (!ebt_basic_match(point, eth_hdr(skb), in, out))
 			goto letscontinue;
 
 		if (EBT_MATCH_ITERATE(point, ebt_do_match, skb, &acpar) != 0)
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux