Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci We come into our if_start routine via ether_outp...



details:   https://anonhg.NetBSD.org/src/rev/b2a94b2feecf
branches:  trunk
changeset: 369594:b2a94b2feecf
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Aug 22 17:07:40 2022 +0000

description:
We come into our if_start routine via ether_output(), therefore there is
no need to check-and-pullup to sizeof(struct ether_header).  Instead, we
can simply assert it.

diffstat:

 sys/dev/pci/if_ipw.c |   8 +++-----
 sys/dev/pci/if_iwi.c |  10 +++-------
 2 files changed, 6 insertions(+), 12 deletions(-)

diffs (60 lines):

diff -r 71f0a112ad35 -r b2a94b2feecf sys/dev/pci/if_ipw.c
--- a/sys/dev/pci/if_ipw.c      Mon Aug 22 16:50:25 2022 +0000
+++ b/sys/dev/pci/if_ipw.c      Mon Aug 22 17:07:40 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ipw.c,v 1.74 2021/06/16 00:21:18 riastradh Exp $    */
+/*     $NetBSD: if_ipw.c,v 1.75 2022/08/22 17:07:40 thorpej Exp $      */
 /*     FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp         */
 
 /*-
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.74 2021/06/16 00:21:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.75 2022/08/22 17:07:40 thorpej Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2100 MiniPCI driver
@@ -1530,9 +1530,7 @@
                        break;
                }
 
-               if (m0->m_len < sizeof (struct ether_header) &&
-                   (m0 = m_pullup(m0, sizeof (struct ether_header))) == NULL)
-                       continue;
+               KASSERT(m0->m_len >= sizeof(struct ether_header));
 
                eh = mtod(m0, struct ether_header *);
                ni = ieee80211_find_txnode(ic, eh->ether_dhost);
diff -r 71f0a112ad35 -r b2a94b2feecf sys/dev/pci/if_iwi.c
--- a/sys/dev/pci/if_iwi.c      Mon Aug 22 16:50:25 2022 +0000
+++ b/sys/dev/pci/if_iwi.c      Mon Aug 22 17:07:40 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iwi.c,v 1.118 2022/05/23 13:53:37 rin Exp $  */
+/*     $NetBSD: if_iwi.c,v 1.119 2022/08/22 17:07:40 thorpej Exp $  */
 /*     $OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $     */
 
 /*-
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.118 2022/05/23 13:53:37 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.119 2022/08/22 17:07:40 thorpej Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
@@ -1785,11 +1785,7 @@
                if (m0 == NULL)
                        break;
 
-               if (m0->m_len < sizeof (struct ether_header) &&
-                   (m0 = m_pullup(m0, sizeof (struct ether_header))) == NULL) {
-                       if_statinc(ifp, if_oerrors);
-                       continue;
-               }
+               KASSERT(m0->m_len >= sizeof(struct ether_header));
 
                eh = mtod(m0, struct ether_header *);
                ni = ieee80211_find_txnode(ic, eh->ether_dhost);



Home | Main Index | Thread Index | Old Index