mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2026-01-03 13:53:51 +01:00
ACCOUNT: correctly account for network-order addresses on BE arches
This commit is contained in:
@@ -39,8 +39,9 @@ char *addr_to_dotted(unsigned int addr)
|
||||
static char buf[17];
|
||||
const unsigned char *bytep;
|
||||
|
||||
addr = ntohl(addr);
|
||||
bytep = (const unsigned char *)&addr;
|
||||
snprintf(buf, 16, "%u.%u.%u.%u", bytep[0], bytep[1], bytep[2], bytep[3]);
|
||||
snprintf(buf, 16, "%u.%u.%u.%u", bytep[3], bytep[2], bytep[1], bytep[0]);
|
||||
buf[16] = 0;
|
||||
return buf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user