summaryrefslogtreecommitdiff
path: root/pcap-usb-linux.c
diff options
context:
space:
mode:
authorguy <guy>2008-11-24 17:40:19 +0000
committerguy <guy>2008-11-24 17:40:19 +0000
commitdc524007693a4eebc7335a334aa0f6869a8cdc1d (patch)
tree0f4460b9d0e165c082a7f91b535ab2cd0d9c7c1c /pcap-usb-linux.c
parentb33b2ef32ad10d460768b6528dbd9e7298f01360 (diff)
downloadlibpcap-dc524007693a4eebc7335a334aa0f6869a8cdc1d.tar.gz
Roberto Mariani:
put the transfer direction in the uppermost bit of the endpoint number, rather than the uppermost bit of the transfer type, when reading in text mode, just as is the case in binary mode; check the URB data length against 0 when deciding whether there's no URB tag.
Diffstat (limited to 'pcap-usb-linux.c')
-rw-r--r--pcap-usb-linux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c
index f6dc7057..3858e849 100644
--- a/pcap-usb-linux.c
+++ b/pcap-usb-linux.c
@@ -34,7 +34,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-usb-linux.c,v 1.24 2008-04-14 21:06:09 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-usb-linux.c,v 1.25 2008-11-24 17:40:19 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -351,7 +351,6 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
return -1;
}
uhdr->id = tag;
- uhdr->endpoint_number = ep_num;
uhdr->device_address = dev_addr;
uhdr->bus_id = handle->md.ifindex;
uhdr->status = 0;
@@ -378,7 +377,7 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
else if (pipeid1 == 'B')
urb_transfer = URB_BULK;
if (pipeid2 == 'i') {
- urb_transfer |= URB_TRANSFER_IN;
+ ep_num |= URB_TRANSFER_IN;
incoming = 1;
}
if (etype == 'C')
@@ -395,6 +394,7 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
return 0;
uhdr->event_type = etype;
uhdr->transfer_type = urb_transfer;
+ uhdr->endpoint_number = ep_num;
pkth.caplen = sizeof(pcap_usb_header);
rawdata += sizeof(pcap_usb_header);
@@ -447,7 +447,7 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
uhdr->urb_len = urb_len;
uhdr->data_flag = 1;
data_len = 0;
- if (uhdr->urb_len == pkth.caplen)
+ if (uhdr->urb_len == 0)
goto got;
/* check for data presence; data is present if and only if urb tag is '=' */