[Click] [Patch] fix endianess in radiotap encap

Cliff Frey cliff at meraki.com
Fri Oct 15 14:46:49 EDT 2010


It sure looks reasonable to me.  I'm not actually using the element
personally... the cpu_to_leXX changes should all be no-ops on x86, which is
likely the only architecture that this has been tested on before...

I don't know about the retries part... I might lean towards setting it
to WIFI_MAX_RETRIES rather than WIFI_MAX_RETRIES+1, but I'm not sure if I
know exactly what the fields mean.

So I would say that it's fine to commit.

Cliff

On Fri, Oct 15, 2010 at 4:09 AM, Roberto Riggio <
roberto.riggio at create-net.org> wrote:

>  is this patch suitable for merging?
>
> Il 11/05/2010 20:12, Roberto Riggio ha scritto:
> > This patch fixes the following issues
> > 1) len and flag must always be LE.
> > 2) the radiotapencap element specifies that the data_retries entry
> > is present, however it does not check the parameter is really different
> > from zero. this is a problem on the ath9k driver that in this case does
> not
> > transmitt the frame
> >
> > --
> > diff --git a/elements/wifi/radiotapencap.cc
> b/elements/wifi/radiotapencap.cc
> > index 37d2d69..d481f1c 100644
> > --- a/elements/wifi/radiotapencap.cc
> > +++ b/elements/wifi/radiotapencap.cc
> > @@ -88,14 +88,16 @@ RadiotapEncap::simple_action(Packet *p)
> >          memset(crh, 0, sizeof(struct click_radiotap_header));
> >
> >          crh->wt_ihdr.it_version = 0;
> > -      crh->wt_ihdr.it_len = sizeof(struct click_radiotap_header);
> > -      crh->wt_ihdr.it_present = CLICK_RADIOTAP_PRESENT;
> > +      crh->wt_ihdr.it_len = cpu_to_le16(sizeof(struct
> > click_radiotap_header));
> > +      crh->wt_ihdr.it_present = cpu_to_le32(CLICK_RADIOTAP_PRESENT);
> >
> >          crh->wt_rate = ceh->rate;
> >          crh->wt_txpower = ceh->power;
> >          crh->wt_rts_retries = 0;
> >          if (ceh->max_tries>  0) {
> >              crh->wt_data_retries = ceh->max_tries - 1;
> > +      } else {
> > +          crh->wt_data_retries = WIFI_MAX_RETRIES+1;
> >          }
> >      }
> > _______________________________________________
> > click mailing list
> > click at amsterdam.lcs.mit.edu
> > https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> >
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list