Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci when the packet size was just n*MCLBYTES, there ...



details:   https://anonhg.NetBSD.org/src/rev/32b12b09b9c6
branches:  trunk
changeset: 961339:32b12b09b9c6
user:      ryo <ryo%NetBSD.org@localhost>
date:      Fri Apr 16 08:07:02 2021 +0000

description:
when the packet size was just n*MCLBYTES, there was an inconsistency in the length of mbuf.

diffstat:

 sys/dev/pci/if_aq.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 74a23ca791c3 -r 32b12b09b9c6 sys/dev/pci/if_aq.c
--- a/sys/dev/pci/if_aq.c       Fri Apr 16 07:45:41 2021 +0000
+++ b/sys/dev/pci/if_aq.c       Fri Apr 16 08:07:02 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_aq.c,v 1.23 2021/04/15 09:05:24 ryo Exp $   */
+/*     $NetBSD: if_aq.c,v 1.24 2021/04/16 08:07:02 ryo Exp $   */
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.23 2021/04/15 09:05:24 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.24 2021/04/16 08:07:02 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -4340,7 +4340,10 @@
                        m->m_len = MCLBYTES;
                } else {
                        /* last buffer */
-                       m->m_len = rxd_pktlen % MCLBYTES;
+                       int mlen = rxd_pktlen % MCLBYTES;
+                       if (mlen == 0)
+                               mlen = MCLBYTES;
+                       m->m_len = mlen;
                        m0->m_pkthdr.len = rxd_pktlen;
                        /* VLAN offloading */
                        if ((sc->sc_ethercom.ec_capenable &



Home | Main Index | Thread Index | Old Index