Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/net80211 Node managment may be called from softint...



details:   https://anonhg.NetBSD.org/src-all/rev/8a44775147d8
branches:  trunk
changeset: 367146:8a44775147d8
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Thu Feb 11 18:20:29 2021 +0100

description:
Node managment may be called from softint context.

Adjust memory management accordingly (it was inconsistent before).

diffstat:

 sys/net80211/ieee80211_hostap.c |   4 ++--
 sys/net80211/ieee80211_input.c  |   2 +-
 sys/net80211/ieee80211_node.c   |  21 +++++++++++----------
 sys/net80211/ieee80211_sta.c    |   2 +-
 4 files changed, 15 insertions(+), 14 deletions(-)

diffs (132 lines):

diff -r 4c3d4c50d509 -r 8a44775147d8 sys/net80211/ieee80211_hostap.c
--- a/sys/net80211/ieee80211_hostap.c   Wed Feb 03 15:20:50 2021 +0100
+++ b/sys/net80211/ieee80211_hostap.c   Thu Feb 11 18:20:29 2021 +0100
@@ -973,7 +973,7 @@
                 * open auth is attempted.
                 */
                if (ni->ni_challenge != NULL) {
-                       IEEE80211_FREE(ni->ni_challenge, M_80211_NODE,
+                       IEEE80211_MFREE(ni->ni_challenge, M_80211_NODE,
                            IEEE80211_CHALLENGE_LEN);
                        ni->ni_challenge = NULL;
                }
@@ -2170,7 +2170,7 @@
                        return;
                /* discard challenge after association */
                if (ni->ni_challenge != NULL) {
-                       IEEE80211_FREE(ni->ni_challenge, M_80211_NODE,
+                       IEEE80211_MFREE(ni->ni_challenge, M_80211_NODE,
                            IEEE80211_CHALLENGE_LEN);
                        ni->ni_challenge = NULL;
                }
diff -r 4c3d4c50d509 -r 8a44775147d8 sys/net80211/ieee80211_input.c
--- a/sys/net80211/ieee80211_input.c    Wed Feb 03 15:20:50 2021 +0100
+++ b/sys/net80211/ieee80211_input.c    Thu Feb 11 18:20:29 2021 +0100
@@ -559,7 +559,7 @@
 {
        if (ni->ni_challenge == NULL)
                ni->ni_challenge = (uint32_t *)
-                   IEEE80211_ALLOC(IEEE80211_CHALLENGE_LEN,
+                   IEEE80211_MALLOC(IEEE80211_CHALLENGE_LEN,
                      M_80211_NODE, IEEE80211_M_NOWAIT);
        if (ni->ni_challenge == NULL) {
                IEEE80211_NOTE(ni->ni_vap,
diff -r 4c3d4c50d509 -r 8a44775147d8 sys/net80211/ieee80211_node.c
--- a/sys/net80211/ieee80211_node.c     Wed Feb 03 15:20:50 2021 +0100
+++ b/sys/net80211/ieee80211_node.c     Thu Feb 11 18:20:29 2021 +0100
@@ -195,7 +195,7 @@
                            "WARNING: max aid too small, changed to %d\n",
                            vap->iv_max_aid);
                }
-               vap->iv_aid_bitmap = (uint32_t *) IEEE80211_ZALLOC(
+               vap->iv_aid_bitmap = (uint32_t *) IEEE80211_MZALLOC(
                        howmany(vap->iv_max_aid, 32) * sizeof(uint32_t),
                        M_80211_NODE,
                        IEEE80211_M_NOWAIT);
@@ -223,7 +223,7 @@
                vap->iv_bss = NULL;
        }
        if (vap->iv_aid_bitmap != NULL) {
-               IEEE80211_FREE(vap->iv_aid_bitmap, M_80211_NODE,
+               IEEE80211_MFREE(vap->iv_aid_bitmap, M_80211_NODE,
                    howmany(vap->iv_max_aid, 32) * sizeof(uint32_t));
                vap->iv_aid_bitmap = NULL;
        }
@@ -1119,8 +1119,9 @@
 {
        struct ieee80211_node *ni;
 
-       ni = (struct ieee80211_node *) IEEE80211_ZALLOC(sizeof(struct ieee80211_node),
-               M_80211_NODE, IEEE80211_M_NOWAIT);
+       ni = (struct ieee80211_node *) IEEE80211_MZALLOC(
+           sizeof(struct ieee80211_node),
+           M_80211_NODE, IEEE80211_M_NOWAIT);
        return ni;
 }
 
@@ -1296,7 +1297,7 @@
 
        ni->ni_associd = 0;
        if (ni->ni_challenge != NULL) {
-               IEEE80211_FREE(ni->ni_challenge, M_80211_NODE,
+               IEEE80211_MFREE(ni->ni_challenge, M_80211_NODE,
                    IEEE80211_CHALLENGE_LEN);
                ni->ni_challenge = NULL;
        }
@@ -1332,7 +1333,7 @@
        ic->ic_node_cleanup(ni);
        ieee80211_ies_cleanup(&ni->ni_ies);
        ieee80211_psq_cleanup(&ni->ni_psq);
-       IEEE80211_FREE(ni, M_80211_NODE, sizeof(*ni));
+       IEEE80211_MFREE(ni, M_80211_NODE, sizeof(*ni));
 }
 
 static void
@@ -2313,7 +2314,7 @@
        nt->nt_inact_init = inact;
        nt->nt_keyixmax = keyixmax;
        if (nt->nt_keyixmax > 0) {
-               nt->nt_keyixmap = (struct ieee80211_node **)IEEE80211_ZALLOC(
+               nt->nt_keyixmap = (struct ieee80211_node **)IEEE80211_MZALLOC(
                        keyixmax * sizeof(struct ieee80211_node *),
                        M_80211_NODE,
                        IEEE80211_M_NOWAIT);
@@ -2375,7 +2376,7 @@
                                printf("%s: %s[%u] still active\n", __func__,
                                        nt->nt_name, i);
 #endif
-               IEEE80211_FREE(nt->nt_keyixmap, M_80211_NODE,
+               IEEE80211_MFREE(nt->nt_keyixmap, M_80211_NODE,
                    nt->nt_keyixmax * sizeof(struct ieee80211_node *));
                nt->nt_keyixmap = NULL;
        }
@@ -2619,7 +2620,7 @@
                return (0);
        }
        size = count * sizeof(struct ieee80211_node *);
-       ni_arr = (struct ieee80211_node **) IEEE80211_ZALLOC(size,
+       ni_arr = (struct ieee80211_node **) IEEE80211_MZALLOC(size,
            M_80211_NODE, IEEE80211_M_NOWAIT);
        if (ni_arr == NULL) {
                IEEE80211_NODE_UNLOCK(nt);
@@ -2646,7 +2647,7 @@
                ieee80211_free_node(ni_arr[i]);
        }
 
-       IEEE80211_FREE(ni_arr, M_80211_NODE, size);
+       IEEE80211_MFREE(ni_arr, M_80211_NODE, size);
 
        return (0);
 }
diff -r 4c3d4c50d509 -r 8a44775147d8 sys/net80211/ieee80211_sta.c
--- a/sys/net80211/ieee80211_sta.c      Wed Feb 03 15:20:50 2021 +0100
+++ b/sys/net80211/ieee80211_sta.c      Thu Feb 11 18:20:29 2021 +0100
@@ -1118,7 +1118,7 @@
        switch (seq) {
        case IEEE80211_AUTH_SHARED_PASS:
                if (ni->ni_challenge != NULL) {
-                       IEEE80211_FREE(ni->ni_challenge, M_80211_NODE,
+                       IEEE80211_MFREE(ni->ni_challenge, M_80211_NODE,
                            IEEE80211_CHALLENGE_LEN);
                        ni->ni_challenge = NULL;
                }



Home | Main Index | Thread Index | Old Index