All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] mac80211: support radiotap vendor namespace RX data
Date: Fri, 23 Nov 2012 08:25:35 +0100	[thread overview]
Message-ID: <50AF24EF.7080800@neratec.com> (raw)
In-Reply-To: <50ADE504.3060508@neratec.com>

On 11/22/2012 09:40 AM, Wojciech Dubowik wrote:
> On 11/22/2012 09:41 AM, Johannes Berg wrote:
>> On Thu, 2012-11-22 at 09:34 +0100, Johannes Berg wrote:
>>> On Thu, 2012-11-22 at 09:22 +0100, Wojciech Dubowik wrote:
>>>> Shouldn't all functions between ieee80211_rx
>>>> and remove_monitor_info map header with
>>>> (struct ieee80211_hdr *)(skb->data + status->vendor_radiotap_len) ?
>>>>
>>>> Otherwise function like should_drop_frame uses header mapped over
>>>> potential vendor data.
>>> Huh, yes, how did I miss that. It only applies to should_drop_frame()
>>> though, or do you see any other place?
>> So I think this is sufficient?
> I guess so. I will test it today.
> Wojtek
I have tested with ath9k vendor data and it doesn't seem to drop frames. 
I will post my patch as RFC
once I clean it up a bit. Just for reference.

Wojtek
>>
>> johannes
>>
>> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
>> index ec15a49..ec87902 100644
>> --- a/net/mac80211/rx.c
>> +++ b/net/mac80211/rx.c
>> @@ -62,13 +62,16 @@ static struct sk_buff *remove_monitor_info(struct 
>> ieee80211_local *local,
>>   static inline int should_drop_frame(struct sk_buff *skb, int 
>> present_fcs_len)
>>   {
>>       struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
>> -    struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
>> +    struct ieee80211_hdr *hdr;
>> +
>> +    hdr = (void *)(skb->data + status->vendor_radiotap_len);
>>         if (status->flag & (RX_FLAG_FAILED_FCS_CRC |
>>                   RX_FLAG_FAILED_PLCP_CRC |
>>                   RX_FLAG_AMPDU_IS_ZEROLEN))
>>           return 1;
>> -    if (unlikely(skb->len < 16 + present_fcs_len))
>> +    if (unlikely(skb->len < 16 + present_fcs_len +
>> +                status->vendor_radiotap_len))
>>           return 1;
>>       if (ieee80211_is_ctl(hdr->frame_control) &&
>>           !ieee80211_is_pspoll(hdr->frame_control) &&
>> @@ -341,8 +344,8 @@ ieee80211_rx_monitor(struct ieee80211_local 
>> *local, struct sk_buff *origskb,
>>       if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS)
>>           present_fcs_len = FCS_LEN;
>>   -    /* make sure hdr->frame_control is on the linear part */
>> -    if (!pskb_may_pull(origskb, 2)) {
>> +    /* ensure hdr->frame_control and vendor radiotap data are in skb 
>> head */
>> +    if (!pskb_may_pull(origskb, 2 + status->vendor_radiotap_len)) {
>>           dev_kfree_skb(origskb);
>>           return NULL;
>>       }
>>
>>
>
> -- 
> To unsubscribe from this list: send the line "unsubscribe 
> linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2012-11-23  7:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-16 10:26 [PATCH] mac80211: support radiotap vendor namespace RX data Johannes Berg
2012-11-16 10:47 ` Kalle Valo
2012-11-16 11:06   ` [PATCH v2] " Johannes Berg
2012-11-19 14:45     ` Johannes Berg
2012-11-22  8:22     ` Wojciech Dubowik
2012-11-22  8:34       ` Johannes Berg
2012-11-22  8:32         ` Wojciech Dubowik
2012-11-22  8:41         ` Johannes Berg
2012-11-22  8:40           ` Wojciech Dubowik
2012-11-23  7:25             ` Wojciech Dubowik [this message]
2012-11-23  7:39               ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50AF24EF.7080800@neratec.com \
    --to=wojciech.dubowik@neratec.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.