From: Roy Marples Date: Fri, 13 Mar 2015 19:51:33 +0000 (+0000) Subject: Cast random for gcc. X-Git-Tag: v6.8.0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bc7487f7051cd2dded4721a8bfa645d423649c6;p=thirdparty%2Fdhcpcd.git Cast random for gcc. --- diff --git a/ipv4ll.c b/ipv4ll.c index 71167924..997909fb 100644 --- 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)