aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-03-15 10:39:24 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-20 09:24:30 (GMT)
commit7f46ad9ee56e814eb06445d4eb5f93260a757528 (patch)
treedd1119a86ccc32f8b5c46e86f1abb7e6ca9a4ae2 /src/drivers/driver_bsd.c
parent192964ddc3b075ef0502e402e2db6d76ffe4c04c (diff)
downloadhostap-7f46ad9ee56e814eb06445d4eb5f93260a757528.zip
hostap-7f46ad9ee56e814eb06445d4eb5f93260a757528.tar.gz
hostap-7f46ad9ee56e814eb06445d4eb5f93260a757528.tar.bz2
BSD: Only down the interface once we are sure we can work with it
Signed-off-by: Roy Marples <roy@marples.name>
Diffstat (limited to 'src/drivers/driver_bsd.c')
-rw-r--r--src/drivers/driver_bsd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
index 99f3504..a6ca9a8 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);