]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Cast random for gcc.
authorRoy Marples <roy@marples.name>
Fri, 13 Mar 2015 19:51:33 +0000 (19:51 +0000)
committerRoy Marples <roy@marples.name>
Fri, 13 Mar 2015 19:51:33 +0000 (19:51 +0000)
ipv4ll.c

index 711679247a8abb9b0feb9b434bb5b4fc11a49cd6..997909fb29acb961b7d91dd303f5e6e8ac2a64e7 100644 (file)
--- a/ipv4ll.c
+++ b/ipv4ll.c
@@ -81,7 +81,8 @@ ipv4ll_pick_addr(const struct arp_state *astate)
                /* RFC 3927 Section 2.1 states that the first 256 and
                 * last 256 addresses are reserved for future use.
                 * See ipv4ll_start for why we don't use arc4_random. */
-               addr = ntohl(LINKLOCAL_ADDR | ((random() % 0xFD00) + 0x0100));
+               addr = ntohl(LINKLOCAL_ADDR |
+                   ((uint32_t)(random() % 0xFD00) + 0x0100));
 
                /* No point using a failed address */
                if (addr == astate->failed.s_addr)