summaryrefslogtreecommitdiff
path: root/accel-pppd/utils.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-06-03 21:33:23 +0400
committerDmitry Kozlov <xeb@mail.ru>2014-06-03 21:33:23 +0400
commit093c53e3e08abb609cae6e58b1b438616c57c17f (patch)
tree10599557e5373498f773b57e0af84e7219875434 /accel-pppd/utils.c
parentb002a1bdc060bf26497ea65174bfb66468560abb (diff)
downloadaccel-ppp-093c53e3e08abb609cae6e58b1b438616c57c17f.tar.gz
accel-ppp-093c53e3e08abb609cae6e58b1b438616c57c17f.zip
make IPv4 address to string conversions endian friendly
Diffstat (limited to 'accel-pppd/utils.c')
-rw-r--r--accel-pppd/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/accel-pppd/utils.c b/accel-pppd/utils.c
index 45e8709c..81b4c993 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,