]> The Tcpdump Group git mirrors - libpcap/commitdiff
Cast away a warning.
authorGuy Harris <[email protected]>
Sat, 9 Sep 2017 21:52:05 +0000 (14:52 -0700)
committerGuy Harris <[email protected]>
Sat, 9 Sep 2017 21:52:05 +0000 (14:52 -0700)
We've already ensured that len is > 0; just cast it to u_int.

pcap-netfilter-linux.c

index 85899559ac61b5c5c9b11309eba444db8449b2b9..52ee7dc058261d26d0add2a47c1265da99dfb667 100644 (file)
@@ -375,7 +375,7 @@ netfilter_send_config_msg(const pcap_t *handle, u_int16_t msg_type, int ack, u_i
                if (snl.nl_pid != 0 || seq_id != nlh->nlmsg_seq)        /* if not from kernel or wrong sequence skip */
                        continue;
 
-               while ((u_int)len >= NLMSG_SPACE(0) && NLMSG_OK(nlh, len)) {
+               while ((u_int)len >= NLMSG_SPACE(0) && NLMSG_OK(nlh, (u_int)len)) {
                        if (nlh->nlmsg_type == NLMSG_ERROR || (nlh->nlmsg_type == NLMSG_DONE && nlh->nlmsg_flags & NLM_F_MULTI)) {
                                if (nlh->nlmsg_len < NLMSG_ALIGN(sizeof(struct nlmsgerr))) {
                                        errno = EBADMSG;