diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2014-06-03 21:33:23 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-06-03 21:33:23 +0400 |
commit | 093c53e3e08abb609cae6e58b1b438616c57c17f (patch) | |
tree | 10599557e5373498f773b57e0af84e7219875434 /accel-pppd/utils.c | |
parent | b002a1bdc060bf26497ea65174bfb66468560abb (diff) | |
download | accel-ppp-xebd-093c53e3e08abb609cae6e58b1b438616c57c17f.tar.gz accel-ppp-xebd-093c53e3e08abb609cae6e58b1b438616c57c17f.zip |
make IPv4 address to string conversions endian friendly
Diffstat (limited to 'accel-pppd/utils.c')
-rw-r--r-- | accel-pppd/utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/accel-pppd/utils.c b/accel-pppd/utils.c index 45e8709..81b4c99 100644 --- a/accel-pppd/utils.c +++ b/accel-pppd/utils.c @@ -12,7 +12,8 @@ extern int urandom_fd; void __export u_inet_ntoa(in_addr_t addr, char *str) { - sprintf(str, "%i.%i.%i.%i", addr & 0xff, (addr >> 8) & 0xff, (addr >> 16) & 0xff, (addr >> 24) & 0xff); + addr = ntohl(addr); + sprintf(str, "%i.%i.%i.%i", (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff); } int __export u_readlong(long int *dst, const char *src, |