From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Hambley Subject: Re: Fwd: ieee80211_radiotap_iterator_next return values Date: Fri, 10 May 2013 16:40:23 +0200 Message-ID: References: <1368192729.8390.17.camel@jlt4.sipsolutions.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0122a146acf6e704dc5e25b4 Return-path: In-Reply-To: <1368192729.8390.17.camel-8Nb76shvtaUJvtFkdXX2HixXY32XiHfO@public.gmane.org> Sender: radiotap-owner-sUITvd46vNxg9hUCZPvPmw@public.gmane.org To: radiotap-S783fYmB3Ccdnm+yROfE0A@public.gmane.org List-Id: radiotap@radiotap.org --089e0122a146acf6e704dc5e25b4 Content-Type: text/plain; charset=UTF-8 Hi Johannes, I hadn't even considered that, I'll have to go and have a look for the userspace implementation of those functions, I'd suppose that the ones I have pulled in are probably from the kernel if they are returning `1`. Are these functions included with any of the radiotap (tcpdump, libpcap in particular) codebases? Or something similar. Thanks, good to know I did manage to register myself for the list correctly! Lee Hambley -- http://lee.hambley.name/ +49 (0) 170 298 5667 On 10 May 2013 15:32, Johannes Berg wrote: > On Fri, 2013-05-10 at 14:55 +0200, Lee Hambley wrote: > > > int ret = ieee80211_radiotap_iterator_init(&rti, rth, rth->it_len); > > while(!ret) { > > printf("Itteration: %d\n", count++); > > ret = ieee80211_radiotap_iterator_next(&rti); > > > > > There's limited scope for having screwed something up in that code, I > > think, I'm confused by the `1' being returned from > > `ieee80211_radiotap_iterator_init' which according to the > > implenentation doesn't seem like an error condition in the > > implementation > http://lxr.free-electrons.com/source/net/wireless/radiotap.c#L95 > > I think you're confusing the userspace and Linux kernel implementation, > though they're very similar. In any case, > ieee80211_radiotap_iterator_next() cannot return 1, unless one of the > error values is defined to -1 (it returns -EINVAL and a few others) > > johannes > > > --089e0122a146acf6e704dc5e25b4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Johannes,

I hadn't even consider= ed that, I'll have to go and have a look for the userspace implementati= on of those functions, I'd suppose that the ones I have pulled in are p= robably from the kernel if they are returning `1`.

Are these functions included with any of the radi= otap (tcpdump, libpcap in particular) codebases? Or something similar.

Thanks, good to know I did manage to regis= ter myself for the list correctly!

Lee Hambley
--<= /div>
+49 (0) 170 298 5667


On 10 May 2013 15:32, Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> wrote:
On Fri, 2013-05-10 at 14:55 +0200, Lee Hambley wrote:

> int ret =3D ieee80211_radiotap_iterator_init(&rti, rth, rth->it= _len);
> while(!ret) {
> =C2=A0 printf("Itteration: %d\n", count++);
> =C2=A0 ret =3D ieee80211_radiotap_iterator_next(&rti);

>
> There's limited scope for having screwed s= omething up in that code, I
> think, I'm confused by the `1' being returned from
> `ieee80211_radiotap_iterator_init' which according to the
> implenentation doesn't seem like an error condition in the
> implementation http://lxr.free-electrons.com/sourc= e/net/wireless/radiotap.c#L95

I think you're confusing the userspace and Linux kernel implement= ation,
though they're very similar. In any case,
ieee80211_radiotap_iterator_next() cannot return 1, unless one of the
error values is defined to -1 (it returns -EINVAL and a few others)

johannes



--089e0122a146acf6e704dc5e25b4--