Fix endian issue in compare_addr(), solves auto detection of "option dest" for redire...
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 6 Jun 2013 10:35:50 +0000 (12:35 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 6 Jun 2013 10:35:50 +0000 (12:35 +0200)
redirects.c

index e5945f048ef94b74e0b543b34bae3ea8832ff77d..15855c9ea74673af8614a7ad7c3ccdc88f1eda08 100644 (file)
@@ -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));
 }