diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1150,7 +1150,7 @@ ssize_t icmp_data_raw_len; double triptime; int dupflag, i, j, recv_len; - uint8_t hlen; + int8_t hlen; uint16_t seq; static int old_rrlen; static char old_rr[MAX_IPOPTLEN]; @@ -1171,7 +1171,7 @@ hlen = (l & 0x0f) << 2; /* Reject IP packets with a short header */ - if (hlen < sizeof(struct ip)) { + if (hlen < (int8_t) sizeof(struct ip)) { if (options & F_VERBOSE) warn("IHL too short (%d bytes) from %s", hlen, inet_ntoa(from->sin_addr));