From fae8e98bd4a70acd52ab92337283635ac7477c39 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 6 Jun 2013 12:35:50 +0200 Subject: [PATCH] Fix endian issue in compare_addr(), solves auto detection of "option dest" for redirects on little endian systems --- redirects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redirects.c b/redirects.c index e5945f0..15855c9 100644 --- a/redirects.c +++ b/redirects.c @@ -121,7 +121,7 @@ compare_addr(struct fw3_address *a, struct fw3_address *b) if (a->family != FW3_FAMILY_V4) return false; - mask = ~((1 << (32 - a->mask)) - 1); + mask = htonl(~((1 << (32 - a->mask)) - 1)); return ((a->address.v4.s_addr & mask) == (b->address.v4.s_addr & mask)); } -- 2.25.1