tcpdump mailing list archives

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


From: Guy Harris <guy () alum mit edu>
Date: Mon, 24 Nov 2008 11:22:43 -0800


On Oct 29, 2008, at 7:29 PM, Jean-Louis wrote:

*** pcap-usb-linux.c    29 Oct 2008 14:17:44 -0000      1.2
--- pcap-usb-linux.c    29 Oct 2008 15:03:27 -0000      1.3
***************
*** 67,78 ****
 #define USB_LINE_LEN 4096


- #define PIPE_IN                       0x80
- #define PIPE_ISOCHRONOUS      0
- #define PIPE_INTERRUPT                1
- #define PIPE_CONTROL          2
- #define PIPE_BULK             3
-
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 #define htols(s) s
 #define htoll(l) l
--- 67,72 ----

Checked into the main and 1.0 branches.

***************
*** 213,218 ****
--- 207,217 ----
        handle->getnonblock_op = pcap_getnonblock_fd;
        handle->setnonblock_op = pcap_setnonblock_fd;

+       /*Monitor mode doesn't apply to USB devices. */
+       if (handle->opt.rfmon) {
+               return PCAP_ERROR_RFMON_NOTSUP;
+       }
+
        /*get usb bus index from device name */
if (sscanf(handle->opt.source, USB_IFACE"%d", &handle- >md.ifindex) != 1)
        {

        ...

Not checked in - if you try to open a device that doesn't exist, the error that should be returned is "there's no such device", not "that device doesn't support monitor mode".

I did, however, check in changes to close the file descriptor before returning PCAP_ERROR_RFMON_NOTSUP, so that we don't leak file descriptors.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: