From: Johannes Stezenbach Date: Thu, 8 Sep 2011 13:39:15 +0000 (+0200) Subject: usbmon vs. tcpdump: fix dropped packet count X-Git-Tag: v3.2-rc1~183^2~134 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=236c448cb6e7f82096101e1ace4b77f8b38f82c8;p=profile%2Fivi%2Fkernel-x86-ivi.git usbmon vs. tcpdump: fix dropped packet count Report the number of dropped packets instead of zero when using the binary usbmon interface with tcpdump. # tcpdump -i usbmon1 -w dump tcpdump: listening on usbmon1, link-type USB_LINUX_MMAPPED (USB with padded Linux header), capture size 65535 bytes ^C2155 packets captured 2155 packets received by filter 1019 packets dropped by kernel Signed-off-by: Johannes Stezenbach Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index a09dbd2..a04b2ff 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c @@ -1101,7 +1101,7 @@ static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg nevents = mon_bin_queued(rp); sp = (struct mon_bin_stats __user *)arg; - if (put_user(rp->cnt_lost, &sp->dropped)) + if (put_user(ndropped, &sp->dropped)) return -EFAULT; if (put_user(nevents, &sp->queued)) return -EFAULT;