Re: Fwd: truncated events from WPA supplicant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry for stupid question. You are right, "len" was not reset

пн, 20 вер. 2021 о 11:54 Johannes Berg <johannes@xxxxxxxxxxxxxxxx> пише:
>
> On Tue, 2021-09-14 at 22:33 +0300, Ros Spolyak wrote:
> > I have subscribed to WPA events in my application and often the
> > received events are truncated. The rest of the time events are
> > correct. Example,
> > <3>CTRL-EVENT-BSS-RE event received (len 20)
> > <3>CTRL-EVENT-DISCON event received (len 20)
> >
> > The code I am using:
> >   if (wpa_ctrl_pending(ctrl_conn_g) > 0) {
> >     char buf[256] = {0};
> >     size_t len = sizeof(buf) - 1;
> >
> >     while (wpa_ctrl_recv(ctrl_conn_g, buf, &len) == 0) {
> >       buf[len] = '\0';
> >       printf("'%s' event received (len %u)", buf, len);
>
> You need to reset 'len' for each loop iteration?
>
> johannes
>

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux