tcpdump mailing list archives

Re: [Patch 3-4] pcap-usb-linux.c


From: Jean-Louis <jelot-tcpdump () jelot it>
Date: Thu, 30 Oct 2008 03:32:38 +0100

Jean-Louis ha scritto:
Jean-Louis ha scritto:
today I have found some bug on pcap-usb-linux.c

now i can try to tell you which are


in "text mode" ther'is direction check, I don't know how I can use this "filter", but the check is broken

If this "filter" is usable, should be added similar code to "bin e mmap mode"
Index: pcap-usb-linux.c
===================================================================
RCS file: /home/jean-louis/cvsroot/libpcap/pcap-usb-linux.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -c -r1.3 -r1.4
*** pcap-usb-linux.c    29 Oct 2008 15:03:27 -0000      1.3
--- pcap-usb-linux.c    29 Oct 2008 16:03:01 -0000      1.4
***************
*** 302,308 ****
        struct pcap_pkthdr pkth;
        pcap_usb_header* uhdr = (pcap_usb_header*)handle->buffer;
        u_char urb_transfer=0;
-       int incoming=0;
  
        /* ignore interrupt system call errors */
        do {
--- 302,307 ----
***************
*** 364,383 ****
                urb_transfer = URB_BULK;
        if (pipeid2 == 'i') {
                ep_num |= URB_TRANSFER_IN;
-               incoming = 1;
        }
-       if (etype == 'C')
-               incoming = !incoming;
  
        /* direction check*/
!       if (incoming)
!       {
!               if (handle->direction == PCAP_D_OUT)
                        return 0;
        }
!       else
!               if (handle->direction == PCAP_D_IN)
!                       return 0;
        uhdr->event_type = etype;
        uhdr->transfer_type = urb_transfer;
        uhdr->endpoint_number = ep_num;
--- 363,377 ----
                urb_transfer = URB_BULK;
        if (pipeid2 == 'i') {
                ep_num |= URB_TRANSFER_IN;
        }
  
        /* direction check*/
!       if (handle->direction != PCAP_D_INOUT) {
!               if (((handle->direction == PCAP_D_OUT) && (ep_num & URB_TRANSFER_IN)) ||
!                   ((handle->direction == PCAP_D_IN) && !(ep_num & URB_TRANSFER_IN)))
                        return 0;
        }
! 
        uhdr->event_type = etype;
        uhdr->transfer_type = urb_transfer;
        uhdr->endpoint_number = ep_num;
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.

Current thread: