aboutsummaryrefslogtreecommitdiffstats
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
parentb33b2ef32ad10d460768b6528dbd9e7298f01360 (diff)
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.
-rw-r--r--CREDITS1
-rw-r--r--pcap-usb-linux.c8
2 files changed, 5 insertions, 4 deletions
diff --git a/CREDITS b/CREDITS
index 64e070e..e940731 100644
--- a/CREDITS
+++ b/CREDITS
@@ -99,6 +99,7 @@ Additional people who have contributed patches:
<rcb-isis at users dot sourceforge dot net>
Richard Stearn <richard at rns-stearn dot demon dot co dot uk>
Rick Jones <raj at cup dot hp dot com>
+ Roberto Mariani <jelot-tcpdump at jelot dot it>
Sagun Shakya <sagun dot shakya at sun dot com>
Scott Barron <sb125499 at ohiou dot edu>
Scott Gifford <sgifford at tir dot com>
diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c
index f6dc705..3858e84 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 '=' */