]> The Tcpdump Group git mirrors - libpcap/commitdiff
Address the compiler warnings after commit 8cff296.
authorDenis Ovsienko <[email protected]>
Thu, 12 Jul 2018 20:09:07 +0000 (20:09 +0000)
committerDenis Ovsienko <[email protected]>
Thu, 12 Jul 2018 20:10:04 +0000 (20:10 +0000)
./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]

pcap-linux.c

index 6e34279a8152ce9393545f4b637cdb1f40cb73d2..a345a1aa7b9d08241ec452544f3fdb066db9361b 100644 (file)
@@ -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.
                 */
                 * 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;
                        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)
 {
 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?
        if (handle->linktype == DLT_LINUX_SLL2) {
                /*
                 * What's the offset?