Message ID | 202005200509.04K5962M013838@slippy.cwsent.com |
---|---|
State | Changes Requested |
Headers | show |
Series | BSD Log Spamming | expand |
Is anyone willing to comment?
On Tue, May 19, 2020 at 10:09:06PM -0700, Cy Schubert wrote: > On BSD, specifically FreeBSD, when disabling the RF radio on a laptop with > communication device toggle key (as it's called on my laptop) otherwise > known as the RF radio kill button, the following errors will be issued once > per second: > > May 19 17:58:35 slippy wpa_supplicant[391]: wlan0: CTRL-EVENT-SCAN-FAILED > ret=-1 retry=1 > May 19 17:58:36 slippy wpa_supplicant[391]: ioctl[SIOCS80211, op=103, > val=0, arg_len=128]: Device not configured > > On Intel the device will remain up however the IFF_RUNNING flag indicates > whether the device is actually enabled and active. The following patch > tests for this and avoids spamming syslog when RF is disabled. > > Silence the once per second CTRL-EVENT-SCAN-FAILED errors when the WiFi > radio is disabled through the communication device toggle key (also known > as the RF raidio kill button). Only the CTRL-EVENT-DISCONNECTED will be > issued. > > Index: contrib/wpa/src/drivers/driver_bsd.c Could you please read the top level CONTRIBUTIONS file and provide a patch with the Signed-off-by: line as described there? > --- contrib/wpa/src/drivers/driver_bsd.c (revision 361269) > +++ contrib/wpa/src/drivers/driver_bsd.c (working copy) > @@ -1358,14 +1358,18 @@ It would also be nice to get the patch in standard git format-patch format so that it is easier to apply.
Index: contrib/wpa/src/drivers/driver_bsd.c =================================================================== --- contrib/wpa/src/drivers/driver_bsd.c (revision 361269) +++ contrib/wpa/src/drivers/driver_bsd.c (working copy) @@ -1358,14 +1358,18 @@ drv = bsd_get_drvindex(global, ifm->ifm_index); if (drv == NULL) return; - if ((ifm->ifm_flags & IFF_UP) == 0 && - (drv->flags & IFF_UP) != 0) { + if (((ifm->ifm_flags & IFF_UP) == 0 || + (ifm->ifm_flags & IFF_RUNNING) == 0) && + (drv->flags & IFF_UP) != 0 && + (drv->flags & IFF_RUNNING) != 0) { wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' DOWN", drv->ifname); wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_DISABLED, NULL); } else if ((ifm->ifm_flags & IFF_UP) != 0 && - (drv->flags & IFF_UP) == 0) { + (ifm->ifm_flags & IFF_RUNNING) != 0 && + ((drv->flags & IFF_UP) == 0 || + (drv->flags & IFF_RUNNING) == 0)) { wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP", drv->ifname); wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED,