All of lore.kernel.org
 help / color / mirror / Atom feed
* Packet injection with ath9k
@ 2010-05-07 16:13 Roberto Riggio
  2010-05-07 16:35 ` Gábor Stefanik
  0 siblings, 1 reply; 6+ messages in thread
From: Roberto Riggio @ 2010-05-07 16:13 UTC (permalink / raw)
  To: linux-wireless

Hi,

I'm writing an application to inject traffic over a wireless interface. 
This app
is working fine on an x86 machine. However if i compile the same app for
an arm platform, no frame are sent over the wireless interface (ath9k).

I'm guessing that this is because of some alignment issues but i cannot 
track
the piece of code that is actually parsing the frame. I've found the
__ieee80211_parse_tx_radiotap in net/mac80211/tx.c function, but it is
not called when i try to inject some traffic, so the frame are dropped
before that.

Any hints?

Thanks
R.

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

* Re: Packet injection with ath9k
  2010-05-07 16:13 Packet injection with ath9k Roberto Riggio
@ 2010-05-07 16:35 ` Gábor Stefanik
  2010-05-07 19:09   ` Roberto Riggio
  0 siblings, 1 reply; 6+ messages in thread
From: Gábor Stefanik @ 2010-05-07 16:35 UTC (permalink / raw)
  To: Roberto Riggio; +Cc: linux-wireless

Hi!
Are you sure it is not your injector that is having alignment issues?
AFAIK the radiotap parser explicitly uses endianness-aware function
everywhere.

On Fri, May 7, 2010 at 6:13 PM, Roberto Riggio
<roberto.riggio@create-net.org> wrote:
> Hi,
>
> I'm writing an application to inject traffic over a wireless interface. This
> app
> is working fine on an x86 machine. However if i compile the same app for
> an arm platform, no frame are sent over the wireless interface (ath9k).
>
> I'm guessing that this is because of some alignment issues but i cannot
> track
> the piece of code that is actually parsing the frame. I've found the
> __ieee80211_parse_tx_radiotap in net/mac80211/tx.c function, but it is
> not called when i try to inject some traffic, so the frame are dropped
> before that.
>
> Any hints?
>
> Thanks
> R.
> --
> 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
>



-- 
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

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

* Re: Packet injection with ath9k
  2010-05-07 16:35 ` Gábor Stefanik
@ 2010-05-07 19:09   ` Roberto Riggio
  2010-05-09 20:24     ` Gábor Stefanik
  0 siblings, 1 reply; 6+ messages in thread
From: Roberto Riggio @ 2010-05-07 19:09 UTC (permalink / raw)
  To: Gábor Stefanik; +Cc: linux-wireless

Hi,

well, that is what i wanted to understand. These are the struct
that I'm using to compose the rediotap header:

struct ieee80211_radiotap_header {
     u_int8_t    it_version;
     u_int8_t    it_pad;
     u_int16_t       it_len;
     u_int32_t       it_present;
} __attribute__((__packed__));

struct click_radiotap_header {
     struct ieee80211_radiotap_header wt_ihdr;
     u_int8_t    wt_rate;
     u_int8_t    wt_txpower;
     u_int8_t        wt_rts_retries;
     u_int8_t        wt_data_retries;
};

The flags are set in order to take into account the fields that I
specify. But i do not know at which point the frame are
dropped.

R.

On 05/07/2010 06:35 PM, Gábor Stefanik wrote:
> Hi!
> Are you sure it is not your injector that is having alignment issues?
> AFAIK the radiotap parser explicitly uses endianness-aware function
> everywhere.
>
> On Fri, May 7, 2010 at 6:13 PM, Roberto Riggio
> <roberto.riggio@create-net.org>  wrote:
>    
>> Hi,
>>
>> I'm writing an application to inject traffic over a wireless interface. This
>> app
>> is working fine on an x86 machine. However if i compile the same app for
>> an arm platform, no frame are sent over the wireless interface (ath9k).
>>
>> I'm guessing that this is because of some alignment issues but i cannot
>> track
>> the piece of code that is actually parsing the frame. I've found the
>> __ieee80211_parse_tx_radiotap in net/mac80211/tx.c function, but it is
>> not called when i try to inject some traffic, so the frame are dropped
>> before that.
>>
>> Any hints?
>>
>> Thanks
>> R.
>> --
>> 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
>>
>>      
>
>
>    


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

* Re: Packet injection with ath9k
  2010-05-07 19:09   ` Roberto Riggio
@ 2010-05-09 20:24     ` Gábor Stefanik
  2010-05-12 16:42       ` Roberto Riggio
  0 siblings, 1 reply; 6+ messages in thread
From: Gábor Stefanik @ 2010-05-09 20:24 UTC (permalink / raw)
  To: Roberto Riggio; +Cc: linux-wireless

2010/5/7 Roberto Riggio <roberto.riggio@create-net.org>:
> Hi,
>
> well, that is what i wanted to understand. These are the struct
> that I'm using to compose the rediotap header:
>
> struct ieee80211_radiotap_header {
>    u_int8_t    it_version;
>    u_int8_t    it_pad;
>    u_int16_t       it_len;
>    u_int32_t       it_present;

AFAIK these 2 fields need to be little-endian even on big-endian
machines. If your system is big-endian, this can cause problems.

> } __attribute__((__packed__));
>
> struct click_radiotap_header {
>    struct ieee80211_radiotap_header wt_ihdr;
>    u_int8_t    wt_rate;
>    u_int8_t    wt_txpower;
>    u_int8_t        wt_rts_retries;
>    u_int8_t        wt_data_retries;
> };
>
> The flags are set in order to take into account the fields that I
> specify. But i do not know at which point the frame are
> dropped.
>
> R.
>
> On 05/07/2010 06:35 PM, Gábor Stefanik wrote:
>>
>> Hi!
>> Are you sure it is not your injector that is having alignment issues?
>> AFAIK the radiotap parser explicitly uses endianness-aware function
>> everywhere.
>>
>> On Fri, May 7, 2010 at 6:13 PM, Roberto Riggio
>> <roberto.riggio@create-net.org>  wrote:
>>
>>>
>>> Hi,
>>>
>>> I'm writing an application to inject traffic over a wireless interface.
>>> This
>>> app
>>> is working fine on an x86 machine. However if i compile the same app for
>>> an arm platform, no frame are sent over the wireless interface (ath9k).
>>>
>>> I'm guessing that this is because of some alignment issues but i cannot
>>> track
>>> the piece of code that is actually parsing the frame. I've found the
>>> __ieee80211_parse_tx_radiotap in net/mac80211/tx.c function, but it is
>>> not called when i try to inject some traffic, so the frame are dropped
>>> before that.
>>>
>>> Any hints?
>>>
>>> Thanks
>>> R.
>>> --
>>> 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
>>>
>>>
>>
>>
>>
>
>



-- 
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

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

* Re: Packet injection with ath9k
  2010-05-09 20:24     ` Gábor Stefanik
@ 2010-05-12 16:42       ` Roberto Riggio
  2010-05-12 16:46         ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Roberto Riggio @ 2010-05-12 16:42 UTC (permalink / raw)
  To: Gábor Stefanik; +Cc: linux-wireless

On 05/09/2010 10:24 PM, Gábor Stefanik wrote:
>>     u_int16_t       it_len;
>>     u_int32_t       it_present;
>>      
> AFAIK these 2 fields need to be little-endian even on big-endian
> machines. If your system is big-endian, this can cause problems.
>    

Thanks, that was indeed the issue. I totally missed this info
in the radiotap website. Everything is working fine now.

R.

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

* Re: Packet injection with ath9k
  2010-05-12 16:42       ` Roberto Riggio
@ 2010-05-12 16:46         ` Johannes Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2010-05-12 16:46 UTC (permalink / raw)
  To: Roberto Riggio; +Cc: Gábor Stefanik, linux-wireless

On Wed, 2010-05-12 at 18:42 +0200, Roberto Riggio wrote:
> On 05/09/2010 10:24 PM, Gábor Stefanik wrote:
> >>     u_int16_t       it_len;
> >>     u_int32_t       it_present;
> >>      
> > AFAIK these 2 fields need to be little-endian even on big-endian
> > machines. If your system is big-endian, this can cause problems.
> >    
> 
> Thanks, that was indeed the issue. I totally missed this info
> in the radiotap website. Everything is working fine now.

I'd make it more prominent, but ... this is what it says now:

Important Radiotap Characteristics

      * Fields are strictly ordered; The developer can specify any
        combination of fields, but the data must appear following the
        radiotap header in the order they are specified in the
        it_present bitmask (or more accurately, in the order the bit
        numbers for the it_present bitmask are defined).
      * Data is specified in little endian byte-order, all data fields
        including the it_version, it_len and it_present fields in the
        radiotap header are to be specified in little endian byte-order.
        This wiki has adopted the Linux convention of using __le64,
        __le32 and __le16 for 64-, 32- and 16-bit little endian
        quantities.

johannes


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

end of thread, other threads:[~2010-05-12 16:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-07 16:13 Packet injection with ath9k Roberto Riggio
2010-05-07 16:35 ` Gábor Stefanik
2010-05-07 19:09   ` Roberto Riggio
2010-05-09 20:24     ` Gábor Stefanik
2010-05-12 16:42       ` Roberto Riggio
2010-05-12 16:46         ` 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.