diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c index f8024aa84..29c0bf407 100644 --- a/src/hlua_fcn.c +++ b/src/hlua_fcn.c @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -1520,10 +1521,10 @@ int hlua_match_addr(lua_State *L) int i; for (i = 0; i < 16; i += 4) { - if ((*(uint32_t *)&addr1->addr.v6.ip.s6_addr[i] & - *(uint32_t *)&addr2->addr.v6.mask.s6_addr[i]) != - (*(uint32_t *)&addr2->addr.v6.ip.s6_addr[i] & - *(uint32_t *)&addr1->addr.v6.mask.s6_addr[i])) + if ((read_u32(&addr1->addr.v6.ip.s6_addr[i]) & + read_u32(&addr2->addr.v6.mask.s6_addr[i])) != + (read_u32(&addr2->addr.v6.ip.s6_addr[i]) & + read_u32(&addr1->addr.v6.mask.s6_addr[i]))) break; } if (i == 16) {