Module Name: src
Committed By: skrll
Date: Sun Aug 11 07:58:16 UTC 2019
Modified Files:
src/sys/dev/usb: if_smsc.c
Log Message:
Correct the length of the buffer to copy into the mbuf. Spotted by
sc dying.
To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/usb/if_smsc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.52 src/sys/dev/usb/if_smsc.c:1.53
--- src/sys/dev/usb/if_smsc.c:1.52 Sun Aug 11 06:54:14 2019
+++ src/sys/dev/usb/if_smsc.c Sun Aug 11 07:58:16 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_smsc.c,v 1.52 2019/08/11 06:54:14 skrll Exp $ */
+/* $NetBSD: if_smsc.c,v 1.53 2019/08/11 07:58:16 skrll Exp $ */
/* $OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $ */
/* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.52 2019/08/11 06:54:14 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.53 2019/08/11 07:58:16 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -970,7 +970,7 @@ smsc_rxeof_loop(struct usbnet * un, stru
}
uint8_t *pktbuf = buf + ETHER_ALIGN;
- size_t buflen = pktlen;
+ size_t buflen = pktlen - ETHER_ALIGN;
int mbuf_flags = M_HASFCS;
int csum_flags = 0;
uint16_t csum_data = 0;