Skip to contentSkip to conversation

ipt_addrtype: Fix matching of inverted destination address type

PATCH In review Anders Grafström 3 participants 4 messages Aug 1, 2008 – Aug 4, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipt_addrtype: Fix matching of inverted destination address type

This patch fixes matching of inverted destination address type.

---
 net/ipv4/netfilter/ipt_addrtype.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/netfilter/ipt_addrtype.c +1 -1
index 49587a4..1f7e005 100644
@@ -70,7 +70,7 @@ addrtype_mt_v1(const struct sk_buff *skb, const struct net_device *in,
 		       (info->flags & IPT_ADDRTYPE_INVERT_SOURCE);
 	if (ret && info->dest)
 		ret &= match_type(dev, iph->daddr, info->dest) ^
-		       (info->flags & IPT_ADDRTYPE_INVERT_DEST);
+		       (info->flags & IPT_ADDRTYPE_INVERT_DEST) >> 1;
 	return ret;
 }
 
Signature · 5 lines
1.5.6.3
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

net/ipv4/netfilter/ipt_addrtype.c addrtype_mt_v1(const struct sk_buff *skb, const struct · line 74

Quoted 8 lines · Anders Grafström

+++ b/net/ipv4/netfilter/ipt_addrtype.c

net/ipv4/netfilter/ipt_addrtype.c +1 -1
@@ -70,7 +70,7 @@ addrtype_mt_v1(const struct sk_buff *skb, const struct
 net_device *in,
 		       (info->flags & IPT_ADDRTYPE_INVERT_SOURCE);
 	if (ret && info->dest)
 		ret &= match_type(dev, iph->daddr, info->dest) ^
-		       (info->flags & IPT_ADDRTYPE_INVERT_DEST);
+		       (info->flags & IPT_ADDRTYPE_INVERT_DEST) >> 1;

I'd just use !!(info->flags & IPT_ADDRTYPE_INVERT_DEST);
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

[PATCH] ipt_addrtype: Fix matching of inverted destination address type

This patch fixes matching of inverted destination address type.

---
Ok, here's the revised patch.

 net/ipv4/netfilter/ipt_addrtype.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/netfilter/ipt_addrtype.c +1 -1
index 49587a4..462a22c 100644
@@ -70,7 +70,7 @@ addrtype_mt_v1(const struct sk_buff *skb, const struct net_device *in,
 		       (info->flags & IPT_ADDRTYPE_INVERT_SOURCE);
 	if (ret && info->dest)
 		ret &= match_type(dev, iph->daddr, info->dest) ^
-		       (info->flags & IPT_ADDRTYPE_INVERT_DEST);
+		       !!(info->flags & IPT_ADDRTYPE_INVERT_DEST);
 	return ret;
 }
 
Signature · 6 lines
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
Quoted 3 lines · Anders Grafström

[PATCH] ipt_addrtype: Fix matching of inverted destination address type

This patch fixes matching of inverted destination address type.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html