From: Jo-Philipp Wich Date: Thu, 6 Jun 2013 10:35:50 +0000 (+0200) Subject: Fix endian issue in compare_addr(), solves auto detection of "option dest" for redire... X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fae8e98bd4a70acd52ab92337283635ac7477c39;p=oweals%2Ffirewall3.git Fix endian issue in compare_addr(), solves auto detection of "option dest" for redirects on little endian systems --- 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)); }