All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: fixed injection in monitor mode
@ 2009-10-16  2:09 Gabriele Gristina
  2009-10-16 14:03 ` John W. Linville
  2009-10-16 14:46 ` Johannes Berg
  0 siblings, 2 replies; 6+ messages in thread
From: Gabriele Gristina @ 2009-10-16  2:09 UTC (permalink / raw)
  To: linux-wireless

I have a problem with mac80211 injection:
if i setup interface in monitor mode with iwconfig and i try to send a
custum 802.11 frame i see twice the packet in monitor interface.
The first packet is right, the second is different only in the radiotap
header: rtap len is fixed to 13 bytes...
If i setup interface with airmon-ng the packet is sended once but the
radiotap header is fixed to 13 bytes.

Patch for 2.6.31.4

--- net/mac80211/main.c.orig    2009-10-16 00:50:00.000000000 +0200
+++ net/mac80211/main.c    2009-10-15 23:06:03.000000000 +0200
@@ -607,6 +607,9 @@
     skb->protocol = htons(ETH_P_802_2);
     memset(skb->cb, 0, sizeof(skb->cb));
 
+    if (!(info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS))
+        goto out_no_echo;
+
     rcu_read_lock();
     list_for_each_entry_rcu(sdata, &local->interfaces, list) {
         if (sdata->vif.type == NL80211_IFTYPE_MONITOR) {
@@ -630,7 +633,8 @@
         skb = NULL;
     }
     rcu_read_unlock();
-    dev_kfree_skb(skb);
+out_no_echo:
+    if (skb) dev_kfree_skb(skb);
 }
 EXPORT_SYMBOL(ieee80211_tx_status);



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mac80211: fixed injection in monitor mode
  2009-10-16  2:09 [PATCH] mac80211: fixed injection in monitor mode Gabriele Gristina
@ 2009-10-16 14:03 ` John W. Linville
  2009-10-16 14:46 ` Johannes Berg
  1 sibling, 0 replies; 6+ messages in thread
From: John W. Linville @ 2009-10-16 14:03 UTC (permalink / raw)
  To: Gabriele Gristina; +Cc: linux-wireless

On Fri, Oct 16, 2009 at 04:09:21AM +0200, Gabriele Gristina wrote:
> I have a problem with mac80211 injection:
> if i setup interface in monitor mode with iwconfig and i try to send a
> custum 802.11 frame i see twice the packet in monitor interface.
> The first packet is right, the second is different only in the radiotap
> header: rtap len is fixed to 13 bytes...
> If i setup interface with airmon-ng the packet is sended once but the
> radiotap header is fixed to 13 bytes.
> 
> Patch for 2.6.31.4
> 
> --- net/mac80211/main.c.orig    2009-10-16 00:50:00.000000000 +0200
> +++ net/mac80211/main.c    2009-10-15 23:06:03.000000000 +0200
> @@ -607,6 +607,9 @@
>      skb->protocol = htons(ETH_P_802_2);
>      memset(skb->cb, 0, sizeof(skb->cb));
>  
> +    if (!(info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS))
> +        goto out_no_echo;
> +
>      rcu_read_lock();
>      list_for_each_entry_rcu(sdata, &local->interfaces, list) {
>          if (sdata->vif.type == NL80211_IFTYPE_MONITOR) {
> @@ -630,7 +633,8 @@
>          skb = NULL;
>      }
>      rcu_read_unlock();
> -    dev_kfree_skb(skb);
> +out_no_echo:
> +    if (skb) dev_kfree_skb(skb);
>  }
>  EXPORT_SYMBOL(ieee80211_tx_status);
> 

Thanks for the patch!  But I need a Signed-off-by line...

	http://linux.yyz.us/patch-format.html

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mac80211: fixed injection in monitor mode
  2009-10-16  2:09 [PATCH] mac80211: fixed injection in monitor mode Gabriele Gristina
  2009-10-16 14:03 ` John W. Linville
@ 2009-10-16 14:46 ` Johannes Berg
  2009-10-16 17:14   ` MatriX
  2009-10-16 17:19   ` Richard Farina
  1 sibling, 2 replies; 6+ messages in thread
From: Johannes Berg @ 2009-10-16 14:46 UTC (permalink / raw)
  To: Gabriele Gristina; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

On Fri, 2009-10-16 at 04:09 +0200, Gabriele Gristina wrote:
> I have a problem with mac80211 injection:
> if i setup interface in monitor mode with iwconfig and i try to send a
> custum 802.11 frame i see twice the packet in monitor interface.
> The first packet is right, the second is different only in the radiotap
> header: rtap len is fixed to 13 bytes...
> If i setup interface with airmon-ng the packet is sended once but the
> radiotap header is fixed to 13 bytes.

This is correct. The patch is wrong.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mac80211: fixed injection in monitor mode
  2009-10-16 14:46 ` Johannes Berg
@ 2009-10-16 17:14   ` MatriX
  2009-10-16 17:19   ` Richard Farina
  1 sibling, 0 replies; 6+ messages in thread
From: MatriX @ 2009-10-16 17:14 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

why is wrong?
there's another way to inject once packet?

2009/10/16, Johannes Berg <johannes@sipsolutions.net>:
> On Fri, 2009-10-16 at 04:09 +0200, Gabriele Gristina wrote:
>> I have a problem with mac80211 injection:
>> if i setup interface in monitor mode with iwconfig and i try to send a
>> custum 802.11 frame i see twice the packet in monitor interface.
>> The first packet is right, the second is different only in the radiotap
>> header: rtap len is fixed to 13 bytes...
>> If i setup interface with airmon-ng the packet is sended once but the
>> radiotap header is fixed to 13 bytes.
>
> This is correct. The patch is wrong.
>
> johannes
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mac80211: fixed injection in monitor mode
  2009-10-16 14:46 ` Johannes Berg
  2009-10-16 17:14   ` MatriX
@ 2009-10-16 17:19   ` Richard Farina
  2009-10-17  0:26     ` Johannes Berg
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Farina @ 2009-10-16 17:19 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Gabriele Gristina, linux-wireless

Johannes Berg wrote:
> On Fri, 2009-10-16 at 04:09 +0200, Gabriele Gristina wrote:
>   
>> I have a problem with mac80211 injection:
>> if i setup interface in monitor mode with iwconfig and i try to send a
>> custum 802.11 frame i see twice the packet in monitor interface.
>> The first packet is right, the second is different only in the radiotap
>> header: rtap len is fixed to 13 bytes...
>> If i setup interface with airmon-ng the packet is sended once but the
>> radiotap header is fixed to 13 bytes.
>>     
>
> This is correct. The patch is wrong.
>
>   
I'm very stupid, could you please elaborate how seeing every single 
packets twice with different headers is "correct"?

Thanks,
Rick
> johannes
>   


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mac80211: fixed injection in monitor mode
  2009-10-16 17:19   ` Richard Farina
@ 2009-10-17  0:26     ` Johannes Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2009-10-17  0:26 UTC (permalink / raw)
  To: Richard Farina; +Cc: Gabriele Gristina, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 866 bytes --]

On Fri, 2009-10-16 at 13:19 -0400, Richard Farina wrote:
> Johannes Berg wrote:
> > On Fri, 2009-10-16 at 04:09 +0200, Gabriele Gristina wrote:
> >   
> >> I have a problem with mac80211 injection:
> >> if i setup interface in monitor mode with iwconfig and i try to send a
> >> custum 802.11 frame i see twice the packet in monitor interface.
> >> The first packet is right, the second is different only in the radiotap
> >> header: rtap len is fixed to 13 bytes...
> >> If i setup interface with airmon-ng the packet is sended once but the
> >> radiotap header is fixed to 13 bytes.
> >>     
> >
> > This is correct. The patch is wrong.
> >
> >   
> I'm very stupid, could you please elaborate how seeing every single 
> packets twice with different headers is "correct"?

Look at the patch. I'ts the injection itself + tx status.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-17  0:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-16  2:09 [PATCH] mac80211: fixed injection in monitor mode Gabriele Gristina
2009-10-16 14:03 ` John W. Linville
2009-10-16 14:46 ` Johannes Berg
2009-10-16 17:14   ` MatriX
2009-10-16 17:19   ` Richard Farina
2009-10-17  0:26     ` Johannes Berg

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.