hostapd_cli reconfigure cmd patch
William Leibzon
william
Sat Jul 16 19:04:37 PDT 2011
You advertise it on hostapd manual pages but never bothered to add it
to software? How come ?!
--- hostapd-0.7.3/hostapd/ctrl_iface.c.orig 2011-07-16 18:20:45.095698003 -0700
+++ hostapd-0.7.3/hostapd/ctrl_iface.c 2011-07-16 18:08:55.571697921 -0700
@@ -100,6 +100,15 @@
return -1;
}
+static int hostapd_ctrl_iface_reconfigure(struct hostapd_data *hapd)
+{
+ if (hostapd_reload_config(hapd->iface) < 0) {
+ wpa_printf(MSG_WARNING, "Failed to read new configuration "
+ "file - continuing with old.");
+ return -1;
+ }
+ return 0;
+}
static int hostapd_ctrl_iface_level(struct hostapd_data *hapd,
struct sockaddr_un *from,
@@ -460,6 +469,10 @@
} else if (os_strncmp(buf, "DISASSOCIATE ", 13) == 0) {
if (hostapd_ctrl_iface_disassociate(hapd, buf + 13))
reply_len = -1;
+ } else if (os_strncmp(buf, "RECONFIGURE", 11) == 0) {
+ if (hostapd_ctrl_iface_reconfigure(hapd))
+ reply_len = -1;
+
#ifdef CONFIG_IEEE80211W
#ifdef NEED_AP_MLME
} else if (os_strncmp(buf, "SA_QUERY ", 9) == 0) {
--- hostapd-0.7.3/hostapd/hostapd_cli.c.orig 2011-07-16 15:41:37.951698075 -0700
+++ hostapd-0.7.3/hostapd/hostapd_cli.c 2011-07-16 15:47:44.215698003 -0700
@@ -96,6 +96,7 @@
#endif /* CONFIG_WPS_OOB */
" wps_ap_pin <cmd> [params..] enable/disable AP PIN\n"
#endif /* CONFIG_WPS */
+" reconfigure reload config file\n"
" help show this usage help\n"
" interface [ifname] show interfaces/select interface\n"
" level <debug level> change debug level\n"
@@ -515,6 +516,10 @@
return wpa_ctrl_command(ctrl, cmd);
}
+static int hostapd_cli_cmd_reconfigure(struct wpa_ctrl *ctrl, int
argc, char* argv[])
+{
+ return wpa_ctrl_command(ctrl, "RECONFIGURE");
+}
static void hostapd_cli_list_interfaces(struct wpa_ctrl *ctrl)
{
@@ -591,6 +596,7 @@
#endif /* CONFIG_WPS_OOB */
{ "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin },
#endif /* CONFIG_WPS */
+ { "reconfigure", hostapd_cli_cmd_reconfigure },
{ "help", hostapd_cli_cmd_help },
{ "interface", hostapd_cli_cmd_interface },
{ "level", hostapd_cli_cmd_level },
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hostapd_cli-reconfigure_cmd.patch
Type: application/octet-stream
Size: 2047 bytes
Desc: not available
Url : http://lists.shmoo.com/pipermail/hostap/attachments/20110716/b4037a05/attachment.obj
More information about the Hostap
mailing list