[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0132b2d13965997e03a98a0f32eabc15e5769462.camel@sipsolutions.net>
Date: Fri, 04 Nov 2022 13:01:54 +0100
From: Johannes Berg <johannes@...solutions.net>
To: Marek Vasut <marex@...x.de>, linux-wireless@...r.kernel.org
Cc: Amitkumar Karwar <amit.karwar@...pinesignals.com>,
Angus Ainslie <angus@...ea.ca>,
Jakub Kicinski <kuba@...nel.org>,
Kalle Valo <kvalo@...nel.org>,
Martin Fuzzey <martin.fuzzey@...wbird.group>,
Martin Kepplinger <martink@...teo.de>,
Prameela Rani Garnepudi <prameela.j04cs@...il.com>,
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@...i.sm>,
Siva Rebbagondla <siva8118@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v2] wifi: rsi: Fix handling of 802.3 EAPOL frames sent
via control port
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
Powered by blists - more mailing lists