aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@computergmbh.de>2008-02-27 15:20:41 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-27 15:20:41 -0500
commit6556874dc3770aefae89907b3cf9be8e23d66137 (patch)
tree9a3d635a5ceb0672858eb4cbecdc13a3e075c599 /net
parentd61f89e9417e68caf9ca801606694c1c960ad179 (diff)
[NETFILTER]: xt_conntrack: fix IPv4 address comparison
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/xt_conntrack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/xt_conntrack.c b/net/netfilter/xt_conntrack.c
index dd192ac74b4a..0c50b2894055 100644
--- a/net/netfilter/xt_conntrack.c
+++ b/net/netfilter/xt_conntrack.c
@@ -122,7 +122,7 @@ conntrack_addrcmp(const union nf_inet_addr *kaddr,
122 const union nf_inet_addr *umask, unsigned int l3proto) 122 const union nf_inet_addr *umask, unsigned int l3proto)
123{ 123{
124 if (l3proto == AF_INET) 124 if (l3proto == AF_INET)
125 return (kaddr->ip & umask->ip) == uaddr->ip; 125 return ((kaddr->ip ^ uaddr->ip) & umask->ip) == 0;
126 else if (l3proto == AF_INET6) 126 else if (l3proto == AF_INET6)
127 return ipv6_masked_addr_cmp(&kaddr->in6, &umask->in6, 127 return ipv6_masked_addr_cmp(&kaddr->in6, &umask->in6,
128 &uaddr->in6) == 0; 128 &uaddr->in6) == 0;