]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
usbmon vs. tcpdump: fix dropped packet count
authorJohannes Stezenbach <js@sig21.net>
Thu, 8 Sep 2011 13:39:15 +0000 (15:39 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Nov 2011 21:47:15 +0000 (13:47 -0800)
commit 236c448cb6e7f82096101e1ace4b77f8b38f82c8 upstream.

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 <js@sig21.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/mon/mon_bin.c

index 385ec052016705386e4f10fa8bffc51a44dec9e9..fa5bd93c7a3fb5d12a5f48efa4fd9dab1cffab1c 100644 (file)
@@ -1074,7 +1074,7 @@ static int mon_bin_ioctl(struct inode *inode, struct file *file,
                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;