[PATCH] CONFIG_AP: Run time reconfiguration fix
Jouni Malinen
j
Tue Jul 5 06:43:02 PDT 2011
On Fri, Apr 01, 2011 at 04:16:54PM +0300, Bartosz.Markowski at tieto.com wrote:
> Small patch for CONFIG_AP mode - run time reconfiguration of AP.
> When receiving DISABLE_NETWORK/REMOVE_NETWORK ap_deinit was not called.
>
> When ssid->mode is WAPS_MODE_AP, call wpa_supplicant_ap_deinit()
> and reset reassociated_connection flag.
Thanks! The issue is real, but the proposed change is not complete
(e.g., D-Bus paths have similar functionality) and has some issues. I
fixed this by a simpler change in wpa_supplicant_mark_disassoc() that
will be on all the code paths that terminate the AP mode.
> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
> @@ -1341,6 +1341,13 @@ static int wpa_supplicant_ctrl_iface_disable_network(
> +#ifdef CONFIG_AP
> + if (ssid->mode == WPAS_MODE_AP) {
This would segfault due to NULL pointer dereference on "wpa_cli
disable_network all". In addition, this would disable the AP mode even
if a completely unrelated network were disabled.
> @@ -1415,6 +1422,12 @@ static int wpa_supplicant_ctrl_iface_remove_network(
> +#ifdef CONFIG_AP
> + if (ssid->mode == WPAS_MODE_AP) {
> + wpa_supplicant_ap_deinit(wpa_s);
> + wpa_s->reassociated_connection = 0;
> + }
> +#endif
This would disable the AP mode even if another network is removed.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list