Source-Changes-HG archive

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

[src/trunk]: src/sys/net80211 Fix previous patch for non-crypto operation: te...



details:   https://anonhg.NetBSD.org/src/rev/ed0582a21409
branches:  trunk
changeset: 583635:ed0582a21409
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Tue Aug 16 02:12:58 2005 +0000

description:
Fix previous patch for non-crypto operation: test for a NULL key
before testing the key flags.

XXX Problems remain.  Nick Hudson points out my questionable
XXX M_COPY_PKTHDR usage.  Also, it seems to me that we may not be
XXX protected against writing a read-only mbuf during the crypto
XXX encapsulation stage, even if hardware does the actual crypto.

diffstat:

 sys/net80211/ieee80211_output.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 500c09ea5f4e -r ed0582a21409 sys/net80211/ieee80211_output.c
--- a/sys/net80211/ieee80211_output.c   Mon Aug 15 23:37:10 2005 +0000
+++ b/sys/net80211/ieee80211_output.c   Tue Aug 16 02:12:58 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ieee80211_output.c,v 1.34 2005/08/15 21:33:26 skrll Exp $      */
+/*     $NetBSD: ieee80211_output.c,v 1.35 2005/08/16 02:12:58 dyoung Exp $     */
 /*-
  * Copyright (c) 2001 Atsushi Onoe
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.26 2005/07/06 01:55:17 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.34 2005/08/15 21:33:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.35 2005/08/16 02:12:58 dyoung Exp $");
 #endif
 
 #include "opt_inet.h"
@@ -410,7 +410,7 @@
         * If we're going to s/w encrypt the mbuf chain make sure it is
         * writable.
         */
-       if (key->wk_flags & IEEE80211_KEY_SWCRYPT) {
+       if (key != NULL && (key->wk_flags & IEEE80211_KEY_SWCRYPT) != 0) {
                error = m_makewritable(&m, 0, M_COPYALL, M_DONTWAIT);
 
                if (error) {



Home | Main Index | Thread Index | Old Index