Search Linux Wireless

Re: [RFC PATCH 4/7] 802.11w: Use BIP (AES-128-CMAC)

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

 



One more thing:

> +/* Get the BIP key index from MMIE; return -1 if this is not a BIP frame */
> +static int ieee80211_get_mmie_keyidx(struct sk_buff *skb)
> +{
> +	struct ieee80211_mgmt *hdr = (struct ieee80211_mgmt *) skb->data;
> +	struct ieee80211_mmie *mmie;
> +
> +	if (skb->len < 24 + sizeof(*mmie) ||
> +	    !is_multicast_ether_addr(hdr->da))
> +		return -1;
> +
> +	if (!ieee80211_is_disassoc(hdr->frame_control) &&
> +	    !ieee80211_is_deauth(hdr->frame_control) &&
> +	    !ieee80211_is_action(hdr->frame_control))
> +		return -1; /* not a robust management frame */

If you reorder the code a bit, you can use the helper below here as
well.

> +static int ieee80211_is_robust_mgmt_frame(__le16 fc)
> +{
> +	return ieee80211_is_disassoc(fc) ||
> +		ieee80211_is_deauth(fc) ||
> +		ieee80211_is_action(fc);
> +}

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux