Stefan Sperling <s...@stsp.name> writes:

> This AP seems to use TKIP for the groupcipher and the iwx
> setkey task doesn't handle this case properly.
>
> Can you try this?

This works great, yielding these diagnostics:

iwx0: associated with 38:ff:36:23:09:ac ssid "MarlinGuest" channel 52 start MCS 
0 long preamble long slot time HT enabled
iwx0: missed beacon threshold set to 30 beacons, beacon interval is 100 TU
iwx0: received msg 1/4 of the 4-way handshake from 38:ff:36:23:09:ac
iwx0: sending msg 2/4 of the 4-way handshake to 38:ff:36:23:09:ac
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
iwx_add_sta_key entered
k->k_flags 100
iwx0: sending action to 38:ff:36:23:09:ac on channel 52 mode 11n
iwx0: sending action to 38:ff:36:23:09:ac on channel 52 mode 11n
iwx0: sending action to 38:ff:36:23:09:ac on channel 52 mode 11n

I think the simpler patch doesn't work, I'll double check.

Thanks a lot!

> diff 7faf78381a333a9545f245f931e6a51077ba6762 /usr/src
> blob - bdf8ce3e1afa332f698e3dc56af77e6acb4f8689
> file + sys/dev/pci/if_iwx.c
> --- sys/dev/pci/if_iwx.c
> +++ sys/dev/pci/if_iwx.c
> @@ -6677,11 +6677,24 @@ iwx_set_key(struct ieee80211com *ic, struct ieee80211_
>      struct ieee80211_key *k)
>  {
>       struct iwx_softc *sc = ic->ic_softc;
> +     struct iwx_node *in = (void *)ni;
>       struct iwx_setkey_task_arg *a;
> +     const int want_keymask = (IWX_NODE_FLAG_HAVE_PAIRWISE_KEY |
> +         IWX_NODE_FLAG_HAVE_GROUP_KEY);
> +     int err;
>  
>       if (k->k_cipher != IEEE80211_CIPHER_CCMP) {
> +             if (k->k_flags & IEEE80211_KEY_GROUP)
> +                     in->in_flags |= IWX_NODE_FLAG_HAVE_GROUP_KEY;
>               /* Fallback to software crypto for other ciphers. */
> -             return (ieee80211_set_key(ic, ni, k));
> +             err = ieee80211_set_key(ic, ni, k);
> +             if (!err && (in->in_flags & want_keymask) == want_keymask) {
> +                     DPRINTF(("marking port %s valid\n",
> +                         ether_sprintf(ni->ni_macaddr)));
> +                     ni->ni_port_valid = 1;
> +                     ieee80211_set_link_state(ic, LINK_STATE_UP);
> +             }
> +             return err;
>       }
>  
>       if (sc->setkey_nkeys >= nitems(sc->setkey_arg))

Reply via email to