Search Linux Wireless

Re: [PATCH v2] wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port

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

 



On Fri, 2022-11-04 at 12:44 +0100, Marek Vasut wrote:
> 
> Therefore, to fix this problem, inspect the ETH_P_802_3 frames in
> the rsi_91x driver, check the ethertype of the encapsulated frame,
> and in case it is ETH_P_PAE, transmit the frame via high-priority
> queue just like other ETH_P_PAE frames.

[...]

> NOTE: I am really unsure about the method of finding out the exact
>       place of ethernet header in the encapsulated packet and then
>       extracting the ethertype from it. Is there maybe some sort of
>       helper function for that purpose ?

[...]

> +bool rsi_is_tx_eapol(struct sk_buff *skb)
> +{
> +	struct ethhdr *eth_hdr;
> +	unsigned int hdr_len;
> +
> +	if (skb->protocol == cpu_to_be16(ETH_P_PAE))
> +		return true;
> +
> +	if (skb->protocol == cpu_to_be16(ETH_P_802_3)) {
> +		hdr_len = ieee80211_get_hdrlen_from_skb(skb) +
> +			  sizeof(rfc1042_header) - ETH_HLEN + 2;
> +		eth_hdr = (struct ethhdr *)(skb->data + hdr_len);
> +		if (eth_hdr->h_proto == cpu_to_be16(ETH_P_PAE))
> +			return true;

This seems unnecessary, maybe mac80211 should set it correctly in the
first place, but anyway you should be able to just generally check

	IEEE80211_SKB_CB(skb)->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO

instead of looking at the skb->protocol.

johannes




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux