Stefan Sperling <[email protected]> writes:

> Taking a fresh look at this in the morning, I think we should be checking
> for errors from ieee80211_set_key() before flagging the group key as valid.
> The only reason this could fail in your case is ENOMEM so it shouldn't
> make a difference regarding your test case.

I tested it for good measure.

> still ok?

OK

>
> There is still room for improvement but that's left for later. I suppose we
> should move the driver back into SCAN state if it fails to set link state UP,
> rather than having it hang. Otherwise an AP could trigger a hang accidentally
> or deliberately by not sending a group key.
>
> 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,16 @@ 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;
> +     int err;
>  
>       if (k->k_cipher != IEEE80211_CIPHER_CCMP) {
>               /* Fallback to software crypto for other ciphers. */
> -             return (ieee80211_set_key(ic, ni, k));
> +             err = ieee80211_set_key(ic, ni, k);
> +             if (!err && (k->k_flags & IEEE80211_KEY_GROUP))
> +                     in->in_flags |= IWX_NODE_FLAG_HAVE_GROUP_KEY;
> +             return err;
>       }
>  
>       if (sc->setkey_nkeys >= nitems(sc->setkey_arg))

Reply via email to