Index: pcap-usb-linux.c =================================================================== RCS file: /tcpdump/master/libpcap/pcap-usb-linux.c,v retrieving revision 1.4 diff -u -r1.4 pcap-usb-linux.c --- pcap-usb-linux.c 5 Oct 2006 17:51:01 -0000 1.4 +++ pcap-usb-linux.c 11 Oct 2006 07:56:48 -0000 @@ -228,8 +228,8 @@ * not mandatory, so does not count on it*/ string[ret] = 0; ret = sscanf(string, "%x %d %c %c%c:%d:%d %s%n", &tag, ×tamp, &etype, - &pipeid1, &pipeid2, &dev_addr, &ep_num, status, - &cnt); + &pipeid1, &pipeid2, &dev_addr, &ep_num, status, + &cnt); if (ret < 8) { snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, @@ -310,11 +310,11 @@ /* try to convert to corresponding integer */ shdr = (pcap_usb_setup*)rawdata; - shdr->bmRequestType = htonl(strtol(str1, 0, 16)); - shdr->bRequest = htonl(strtol(str2, 0, 16)); - shdr->wValue = htonl(strtol(str3, 0, 16)); - shdr->wIndex = htonl(strtol(str4, 0, 16)); - shdr->wLength = htonl(strtol(str5, 0, 16)); + shdr->bmRequestType = strtoul(str1, 0, 16); + shdr->bRequest = strtoul(str2, 0, 16); + shdr->wValue = htons(strtoul(str3, 0, 16)); + shdr->wIndex = htons(strtoul(str4, 0, 16)); + shdr->wLength = htons(strtoul(str5, 0, 16)); pkth.caplen = sizeof(pcap_usb_setup); rawdata += sizeof(pcap_usb_setup); Index: pcap/usb.h =================================================================== RCS file: /tcpdump/master/libpcap/pcap/usb.h,v retrieving revision 1.1 diff -u -r1.1 usb.h --- pcap/usb.h 4 Oct 2006 18:09:22 -0000 1.1 +++ pcap/usb.h 11 Oct 2006 07:56:48 -0000 @@ -56,12 +56,16 @@ bpf_u_int32 setup_packet; } pcap_usb_header; + +/* + * defined in USB specification + */ typedef struct _usb_setup { - bpf_u_int32 bmRequestType; - bpf_u_int32 bRequest; - bpf_u_int32 wValue; - bpf_u_int32 wIndex; - bpf_u_int32 wLength; + u_int8_t bmRequestType; + u_int8_t bRequest; + u_int16_t wValue; + u_int16_t wIndex; + u_int16_t wLength; } pcap_usb_setup; #endif