]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.1.1/usbmon-vs.-tcpdump-fix-dropped-packet-count.patch
Drop watchdog patch
[thirdparty/kernel/stable-queue.git] / releases / 3.1.1 / usbmon-vs.-tcpdump-fix-dropped-packet-count.patch
1 From 236c448cb6e7f82096101e1ace4b77f8b38f82c8 Mon Sep 17 00:00:00 2001
2 From: Johannes Stezenbach <js@sig21.net>
3 Date: Thu, 8 Sep 2011 15:39:15 +0200
4 Subject: usbmon vs. tcpdump: fix dropped packet count
5
6 From: Johannes Stezenbach <js@sig21.net>
7
8 commit 236c448cb6e7f82096101e1ace4b77f8b38f82c8 upstream.
9
10 Report the number of dropped packets instead of zero
11 when using the binary usbmon interface with tcpdump.
12
13 # tcpdump -i usbmon1 -w dump
14 tcpdump: listening on usbmon1, link-type USB_LINUX_MMAPPED (USB with padded Linux header), capture size 65535 bytes
15 ^C2155 packets captured
16 2155 packets received by filter
17 1019 packets dropped by kernel
18
19 Signed-off-by: Johannes Stezenbach <js@sig21.net>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
21
22 ---
23 drivers/usb/mon/mon_bin.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26 --- a/drivers/usb/mon/mon_bin.c
27 +++ b/drivers/usb/mon/mon_bin.c
28 @@ -1101,7 +1101,7 @@ static long mon_bin_ioctl(struct file *f
29 nevents = mon_bin_queued(rp);
30
31 sp = (struct mon_bin_stats __user *)arg;
32 - if (put_user(rp->cnt_lost, &sp->dropped))
33 + if (put_user(ndropped, &sp->dropped))
34 return -EFAULT;
35 if (put_user(nevents, &sp->queued))
36 return -EFAULT;