On Sun, May 31, 2020 at 10:58:19AM +0200, Stefan Sperling wrote:
> On Sat, May 30, 2020 at 03:49:24PM +0000, Mikolaj Kucharski wrote:
> > I see. While I was looking around I found that in function
> > ieee80211_node_leave_rsn() there seems to be dead code
> > assignment of ni->ni_rsn_state. With below change kernel
> > compiles and I'm running it on athn access point and athn
> > client, without any issues so far. When checking objdump -d
> > on ieee80211_node.o there seems to be one small chagne,
> > with below diff.
> 
> Thanks. I will commit your patch.

This reminded me of another cleanup change I've been meaning to do for
a long time now. This one was introduced with the KRACK fix, and I never
went back to fix it.

diff d0e5c0ea53c939a69ea4216ece58b9f73c471c22 /usr/src
blob - 3399e1cd5752671aa57d602b00195b91f6d421fc
file + sys/net80211/ieee80211_node.h
--- sys/net80211/ieee80211_node.h
+++ sys/net80211/ieee80211_node.h
@@ -172,7 +172,7 @@ enum {
        RSNA_SUPP_INITIALIZE,           /* not expecting any messages */
        RSNA_SUPP_PTKSTART,             /* awaiting handshake message 1 */
        RSNA_SUPP_PTKNEGOTIATING,       /* got message 1 and derived PTK */
-       RNSA_SUPP_PTKDONE               /* got message 3 and authenticated AP */
+       RSNA_SUPP_PTKDONE               /* got message 3 and authenticated AP */
 };
 
 struct ieee80211_rxinfo {
blob - 73d028e9995141d2661195135e4815b893da44df
file + sys/net80211/ieee80211_pae_input.c
--- sys/net80211/ieee80211_pae_input.c
+++ sys/net80211/ieee80211_pae_input.c
@@ -375,7 +375,7 @@ ieee80211_recv_4way_msg3(struct ieee80211com *ic,
 #endif
        /* discard if we're not expecting this message */
        if (ni->ni_rsn_supp_state != RSNA_SUPP_PTKNEGOTIATING &&
-           ni->ni_rsn_supp_state != RNSA_SUPP_PTKDONE) {
+           ni->ni_rsn_supp_state != RSNA_SUPP_PTKDONE) {
                DPRINTF(("unexpected in state: %d\n", ni->ni_rsn_supp_state));
                return;
        }
@@ -796,7 +796,7 @@ ieee80211_recv_rsn_group_msg1(struct ieee80211com *ic,
                return;
 #endif
        /* discard if we're not expecting this message */
-       if (ni->ni_rsn_supp_state != RNSA_SUPP_PTKDONE) {
+       if (ni->ni_rsn_supp_state != RSNA_SUPP_PTKDONE) {
                DPRINTF(("unexpected in state: %d\n", ni->ni_rsn_supp_state));
                return;
        }
@@ -954,7 +954,7 @@ ieee80211_recv_wpa_group_msg1(struct ieee80211com *ic,
                return;
 #endif
        /* discard if we're not expecting this message */
-       if (ni->ni_rsn_supp_state != RNSA_SUPP_PTKDONE) {
+       if (ni->ni_rsn_supp_state != RSNA_SUPP_PTKDONE) {
                DPRINTF(("unexpected in state: %d\n", ni->ni_rsn_supp_state));
                return;
        }
blob - 51d0fa44e6d6a67493e7d59d521233651f084bd6
file + sys/net80211/ieee80211_pae_output.c
--- sys/net80211/ieee80211_pae_output.c
+++ sys/net80211/ieee80211_pae_output.c
@@ -444,7 +444,7 @@ ieee80211_send_4way_msg4(struct ieee80211com *ic, stru
        struct mbuf *m;
        u_int16_t info;
 
-       ni->ni_rsn_supp_state = RNSA_SUPP_PTKDONE;
+       ni->ni_rsn_supp_state = RSNA_SUPP_PTKDONE;
        m = ieee80211_get_eapol_key(M_DONTWAIT, MT_DATA, 0);
        if (m == NULL)
                return ENOMEM;

Reply via email to