svn commit: r226474 - head/usr.sbin/usbdump

Hans Petter Selasky hselasky at FreeBSD.org
Mon Oct 17 15:54:20 UTC 2011


Author: hselasky
Date: Mon Oct 17 15:54:20 2011
New Revision: 226474
URL: http://svn.freebsd.org/changeset/base/226474

Log:
  Make the usbdump utility work again by using the correct BPF structures.
  
  MFC after:	3 days

Modified:
  head/usr.sbin/usbdump/usbdump.c

Modified: head/usr.sbin/usbdump/usbdump.c
==============================================================================
--- head/usr.sbin/usbdump/usbdump.c	Mon Oct 17 15:25:38 2011	(r226473)
+++ head/usr.sbin/usbdump/usbdump.c	Mon Oct 17 15:54:20 2011	(r226474)
@@ -283,7 +283,7 @@ hexdump(const uint8_t *region, uint32_t 
 }
 
 static void
-print_apacket(const struct bpf_xhdr *hdr, const uint8_t *ptr, int ptr_len)
+print_apacket(const struct bpf_hdr *hdr, const uint8_t *ptr, int ptr_len)
 {
 	struct tm *tm;
 	struct usbpf_pkthdr up_temp;
@@ -318,8 +318,8 @@ print_apacket(const struct bpf_xhdr *hdr
 	up->up_packet_count = le32toh(up->up_packet_count);
 	up->up_endpoint = le32toh(up->up_endpoint);
 
-	tv.tv_sec = hdr->bh_tstamp.bt_sec;
-	tv.tv_usec = hdr->bh_tstamp.bt_frac;
+	tv.tv_sec = hdr->bh_tstamp.tv_sec;
+	tv.tv_usec = hdr->bh_tstamp.tv_usec;
 	tm = localtime(&tv.tv_sec);
 
 	len = strftime(buf, sizeof(buf), "%H:%M:%S", tm);
@@ -386,12 +386,12 @@ print_apacket(const struct bpf_xhdr *hdr
 static void
 print_packets(uint8_t *data, const int datalen)
 {
-	const struct bpf_xhdr *hdr;
+	const struct bpf_hdr *hdr;
 	uint8_t *ptr;
 	uint8_t *next;
 
 	for (ptr = data; ptr < (data + datalen); ptr = next) {
-		hdr = (const struct bpf_xhdr *)ptr;
+		hdr = (const struct bpf_hdr *)ptr;
 		next = ptr + BPF_WORDALIGN(hdr->bh_hdrlen + hdr->bh_caplen);
 
 		if (w_arg == NULL) {


More information about the svn-src-all mailing list