external/bsd/dhcpcd: Fix a -Wconversion warning.

Type cast uint16_t to size_t to prevent implicit type conversion.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.
gcc version 8.3.0

Reviewed by: roy@, kamil@
This commit is contained in:
fox 2020-02-08 12:17:16 +00:00
parent 53a1bd1628
commit 8d2b6606df

View File

@ -3307,7 +3307,7 @@ is_packet_udp_bootp(void *packet, size_t plen)
memcpy(&udp, (char *)ip + ip_hlen, sizeof(udp));
if (ntohs(udp.uh_ulen) < sizeof(udp))
return false;
if (ip_hlen + ntohs(udp.uh_ulen) > plen)
if (ip_hlen + (size_t)ntohs(udp.uh_ulen) > plen)
return false;
/* Check it's to and from the right ports. */