summaryrefslogtreecommitdiff
path: root/gdhcp/ipv4ll.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-10-11 10:11:51 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-10-11 15:30:21 +0200
commit635f1e814e4e5a0d4f8356475dff32515e78f692 (patch)
treeff7b73473f6c629b09dd14970279b817b6fb2548 /gdhcp/ipv4ll.c
parent51ca65aa0586f7e96dde4bbccdf0fef170d1a3e9 (diff)
downloadconnman-635f1e814e4e5a0d4f8356475dff32515e78f692.tar.gz
connman-635f1e814e4e5a0d4f8356475dff32515e78f692.tar.bz2
connman-635f1e814e4e5a0d4f8356475dff32515e78f692.zip
gdhcp: Use host byte order internally
Convert to network byte order just before sending the packet.
Diffstat (limited to 'gdhcp/ipv4ll.c')
-rw-r--r--gdhcp/ipv4ll.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdhcp/ipv4ll.c b/gdhcp/ipv4ll.c
index 4c095722..007ffe6b 100644
--- a/gdhcp/ipv4ll.c
+++ b/gdhcp/ipv4ll.c
@@ -36,7 +36,7 @@
#include "ipv4ll.h"
/**
- * Return a random link local IP
+ * Return a random link local IP (in host byte order)
*/
uint32_t ipv4ll_random_ip(int seed)
{
@@ -53,7 +53,7 @@ uint32_t ipv4ll_random_ip(int seed)
tmp = rand();
tmp = tmp & IN_CLASSB_HOST;
} while (tmp > (IN_CLASSB_HOST - 0x0200));
- return ((LINKLOCAL_ADDR + 0x0100) + tmp);
+ return ntohl(((LINKLOCAL_ADDR + 0x0100) + tmp));
}
/**