]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Validate configuration parameters on RELOAD command
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 29 Oct 2013 14:42:39 +0000 (16:42 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 29 Oct 2013 14:58:21 +0000 (16:58 +0200)
Reject RELOAD control interface command if the dynamic configuration
changes have resulted into a state where the configuration is invalid.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/ap/hostapd.c

index 8f91bf8d538dc9e926aba9a004540d31225ec831..17bdeb2fc7f564e1f279e491d1b97c5c1bef4dab 100644 (file)
@@ -1198,6 +1198,12 @@ int hostapd_reload_iface(struct hostapd_iface *hapd_iface)
 
        wpa_printf(MSG_DEBUG, "Reload interface %s",
                   hapd_iface->conf->bss[0]->iface);
+       for (j = 0; j < hapd_iface->num_bss; j++)
+               hostapd_set_security_params(hapd_iface->conf->bss[j]);
+       if (hostapd_config_check(hapd_iface->conf) < 0) {
+               wpa_printf(MSG_ERROR, "Updated configuration is invalid");
+               return -1;
+       }
        hostapd_clear_old(hapd_iface);
        for (j = 0; j < hapd_iface->num_bss; j++)
                hostapd_reload_bss(hapd_iface->bss[j]);