Greg Steuck <[email protected]> writes:

> Stefan Sperling <[email protected]> writes:
>
>>> iwx0: received msg 3/4 of the 4-way handshake from 38:ff:36:23:09:ac
>>> iwx0: sending msg 4/4 of the 4-way handshake to 38:ff:36:23:09:ac
>>> 
>>> I never see "iwx0: sending action to" after this.
>>
>> And you still see status: "no network" in ifconfig at this point?
>> This could mean we're failing to set the link UP after the WPA handshake
>> has completed. But I cannot explain why.
>
> Correct. It stays as "no network".

I instrumented iwx_add_sta_key with this patch:

diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c
index 5be1d92ee86..ffbfb4c9591 100644
--- a/sys/dev/pci/if_iwx.c
+++ b/sys/dev/pci/if_iwx.c
@@ -6709,6 +6709,8 @@ iwx_add_sta_key(struct iwx_softc *sc, int sta_id, struct 
ieee80211_node *ni,
            IWX_NODE_FLAG_HAVE_GROUP_KEY);
        int err;
 
+       printf("iwx_add_sta_key entered\n");
+
        /*
         * Keys are stored in 'ni' so 'k' is valid if 'ni' is valid.
         * Currently we only implement station mode where 'ni' is always
@@ -6736,17 +6738,21 @@ iwx_add_sta_key(struct iwx_softc *sc, int sta_id, 
struct ieee80211_node *ni,
        status = IWX_ADD_STA_SUCCESS;
        err = iwx_send_cmd_pdu_status(sc, IWX_ADD_STA_KEY, sizeof(cmd), &cmd,
            &status);
-       if (sc->sc_flags & IWX_FLAG_SHUTDOWN)
+       if (sc->sc_flags & IWX_FLAG_SHUTDOWN) {
+               printf("ECANCELED\n");
                return ECANCELED;
+       }
        if (!err && (status & IWX_ADD_STA_STATUS_MASK) != IWX_ADD_STA_SUCCESS)
                err = EIO;
        if (err) {
                IEEE80211_SEND_MGMT(ic, ni, IEEE80211_FC0_SUBTYPE_DEAUTH,
                    IEEE80211_REASON_AUTH_LEAVE);
                ieee80211_new_state(ic, IEEE80211_S_SCAN, -1);
+               printf("err %d\n", err);
                return err;
        }
 
+       printf("k->k_flags %x\n", k->k_flags);
        if (k->k_flags & IEEE80211_KEY_GROUP) {
                in->in_flags |= IWX_NODE_FLAG_HAVE_GROUP_KEY;
        } else {
@@ -6762,6 +6768,8 @@ iwx_add_sta_key(struct iwx_softc *sc, int sta_id, struct 
ieee80211_node *ni,
                    ether_sprintf(ni->ni_macaddr)));
                ni->ni_port_valid = 1;
                ieee80211_set_link_state(ic, LINK_STATE_UP);
+       } else {
+               printf("in->in_flags %x want_keymask %x\n", in->in_flags, 
want_keymask);
        }
 
        return 0;

I see in the failing case:

iwx0: sending msg 4/4 of the 4-way handshake to 38:ff:36:
iwx_add_sta_key entered
k->k_flags 100
in->in_flags 1 want_keymask 3

... and then crickets. Which is different from the success case:

iwx0: sending msg 4/4 of the 4-way handshake to 0a:ab:60:
iwx_add_sta_key entered
k->k_flags 100
in->in_flags 1 want_keymask 3
iwx_add_sta_key entered
k->k_flags 101
iwx0: sending action to 0a:ab:60: on channel 1 mode 11n

Do I need to figure out the state machines behind iwx and iee80211 now? :)

Thanks
Greg

Reply via email to