From c8178bb7dd399af0d3b5919361c3d7548e189f72 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Fri, 26 Mar 2010 20:12:52 -0600 Subject: [PATCH] Always kill both hostapd and wpa_supplicant, or they may stay running when WPA is disabled or even both can end up running when switching between AP and station modes. --- etc/inc/interfaces.inc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index c3595a6aef..6a6d55cbc2 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1671,6 +1671,9 @@ function interface_wireless_configure($if, &$wl, &$wlcfg) { $wlcmd[] = "authmode open wepmode off "; } + mwexec(kill_hostapd("{$if}")); + mwexec(kill_wpasupplicant("{$if}")); + /* generate wpa_supplicant/hostap config if wpa is enabled */ conf_mount_rw(); @@ -1696,8 +1699,6 @@ EOD; $fd = fopen("{$g['varetc_path']}/wpa_supplicant_{$if}.conf", "w"); fwrite($fd, "{$wpa}"); fclose($fd); - - mwexec(kill_wpasupplicant("{$if}")); } break; case 'hostap': @@ -1756,11 +1757,6 @@ EOD; fclose($fd); } - mwexec(kill_hostapd("{$if}")); - break; - case 'adhoc': - mwexec(kill_hostapd("{$if}")); - mwexec(kill_wpasupplicant("{$if}")); break; }