]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
BSD: don't log SIOCG80211 errors during interface setup
authorRoy Marples <roy@marples.name>
Tue, 21 Jul 2020 10:53:55 +0000 (11:53 +0100)
committerJouni Malinen <j@w1.fi>
Fri, 9 Oct 2020 13:50:36 +0000 (16:50 +0300)
Unless debugging.
wpa_supplicant will log it failed to initialized the driver for the
interface anyway so this just silences some noise for users.

Signed-off-by: Roy Marples <roy@marples.name>
src/drivers/driver_bsd.c

index 5adee13a266d550507cd44171a665dcccc448d4f..a29d2c80164e4386d59e9e2f0edf08454bd39341 100644 (file)
@@ -137,7 +137,9 @@ bsd_get80211(void *priv, struct ieee80211req *ireq, int op, void *arg,
        ireq->i_data = arg;
 
        if (ioctl(drv->global->sock, SIOCG80211, ireq) < 0) {
-               wpa_printf(MSG_ERROR, "ioctl[SIOCG80211, op=%u, "
+               int level = drv->if_removed ? MSG_DEBUG : MSG_ERROR;
+
+               wpa_printf(level, "ioctl[SIOCG80211, op=%u, "
                           "arg_len=%u]: %s", op, arg_len, strerror(errno));
                return -1;
        }
@@ -1468,6 +1470,9 @@ wpa_driver_bsd_init(void *ctx, const char *ifname, void *priv)
        drv->global = priv;
        os_strlcpy(drv->ifname, ifname, sizeof(drv->ifname));
 
+       /* Set the interface as removed until proven to work. */
+       drv->if_removed = 1;
+
        if (!GETPARAM(drv, IEEE80211_IOC_ROAMING, drv->prev_roaming)) {
                wpa_printf(MSG_DEBUG, "%s: failed to get roaming state: %s",
                        __func__, strerror(errno));
@@ -1495,6 +1500,9 @@ wpa_driver_bsd_init(void *ctx, const char *ifname, void *priv)
        if (bsd_get_iface_flags(drv) < 0)
                goto fail;
 
+       /* Proven to work, lets go! */
+       drv->if_removed = 0;
+
        drv->opmode = get80211opmode(drv);
        dl_list_add(&drv->global->ifaces, &drv->list);