From: Roy Marples Date: Tue, 15 Mar 2016 10:39:24 +0000 (+0000) Subject: BSD: Only down the interface once we are sure we can work with it X-Git-Tag: hostap_2_6~706 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f46ad9ee56e814eb06445d4eb5f93260a757528;p=thirdparty%2Fhostap.git BSD: Only down the interface once we are sure we can work with it Signed-off-by: Roy Marples --- diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c index 99f35040a..a6ca9a825 100644 --- a/src/drivers/driver_bsd.c +++ b/src/drivers/driver_bsd.c @@ -1542,11 +1542,7 @@ wpa_driver_bsd_init(void *ctx, const char *ifname, void *priv) drv->ctx = ctx; drv->global = priv; - os_strlcpy(drv->ifname, ifname, sizeof(drv->ifname)); - /* Down interface during setup. */ - if (bsd_ctrl_iface(drv, 0) < 0) - goto fail; if (!GETPARAM(drv, IEEE80211_IOC_ROAMING, drv->prev_roaming)) { wpa_printf(MSG_DEBUG, "%s: failed to get roaming state: %s", @@ -1567,6 +1563,10 @@ wpa_driver_bsd_init(void *ctx, const char *ifname, void *priv) if (wpa_driver_bsd_capa(drv)) goto fail; + /* Down interface during setup. */ + if (bsd_ctrl_iface(drv, 0) < 0) + goto fail; + drv->opmode = get80211opmode(drv); dl_list_add(&drv->global->ifaces, &drv->list);