From: Denis Ovsienko Date: Thu, 12 Jul 2018 20:09:07 +0000 (+0000) Subject: Address the compiler warnings after commit 8cff296. X-Git-Tag: libpcap-1.10-bp~930 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/89f9d9d5b7d24ef244317acc24ddc0aa3665cbb6?ds=sidebyside Address the compiler warnings after commit 8cff296. ./pcap-linux.c: In function ‘pcap_read_packet’: ./pcap-linux.c:1911:7: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (handle->linktype = DLT_LINUX_SLL2) { ^~~~~~ ./pcap-linux.c: In function ‘fix_offset’: ./pcap-linux.c:7169:14: warning: unused variable ‘hdr_len’ [-Wunused-variable] bpf_u_int32 hdr_len; ^~~~~~~ [skip ci] --- diff --git a/pcap-linux.c b/pcap-linux.c index 6e34279a..a345a1aa 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -1908,7 +1908,7 @@ pcap_read_packet(pcap_t *handle, pcap_handler callback, u_char *userdata) * Add the length of the fake header to the length * of packet data we read. */ - if (handle->linktype = DLT_LINUX_SLL2) { + if (handle->linktype == DLT_LINUX_SLL2) { struct sll2_header *hdrp; packet_len += SLL2_HDR_LEN; @@ -7166,8 +7166,6 @@ fix_program(pcap_t *handle, struct sock_fprog *fcode, int is_mmapped) static int fix_offset(pcap_t *handle, struct bpf_insn *p) { - bpf_u_int32 hdr_len; - if (handle->linktype == DLT_LINUX_SLL2) { /* * What's the offset?