[NETFILTER 3/3] xt_iprange: fix subtraction-based comparison

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

 



commit d995f13b64092a8f3fd375a8815841e6fb635cd7
Author: Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx>
Date:   Thu Jan 31 23:12:07 2008 +0100

    [NETFILTER]: xt_iprange: fix subtraction-based comparison
    
    The host address parts need to be converted to host-endian first
    before arithmetic makes any sense on them.
    
    Signed-off-by: Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx>
---
 net/netfilter/xt_iprange.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/xt_iprange.c b/net/netfilter/xt_iprange.c
index 01035fc..624eeda 100644
--- a/net/netfilter/xt_iprange.c
+++ b/net/netfilter/xt_iprange.c
@@ -101,7 +101,7 @@ iprange_ipv6_sub(const struct in6_addr *a, const struct in6_addr *b)
 	int r;
 
 	for (i = 0; i < 4; ++i) {
-		r = (__force u32)a->s6_addr32[i] - (__force u32)b->s6_addr32[i];
+		r = ntohl(a->s6_addr32[i]) - ntohl(b->s6_addr32[i]);
 		if (r != 0)
 			return r;
 	}
-
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