]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Mark config parameter name const
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 21 Jul 2015 10:46:00 +0000 (13:46 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 21 Jul 2015 10:56:19 +0000 (13:56 +0300)
The functions parsing configuration parameters do not modify the name of
the parameter, so mark that function argument constant. In theory, the
value should also be const, but at least for now, number of the parser
functions end up modifying this to simplify parsing.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
hostapd/config_file.c
hostapd/config_file.h
hostapd/ctrl_iface.c

index de6c3218885385d6c6d784b4d828b2f7ce699423..0edf6afc7639810e1e53161cc77cd5dbc35ad732 100644 (file)
@@ -912,11 +912,11 @@ enum {
        IEEE80211_TX_QUEUE_DATA3 = 3 /* used for EDCA AC_BK data */
 };
 
-static int hostapd_config_tx_queue(struct hostapd_config *conf, char *name,
-                                  char *val)
+static int hostapd_config_tx_queue(struct hostapd_config *conf,
+                                  const char *name, const char *val)
 {
        int num;
-       char *pos;
+       const char *pos;
        struct hostapd_tx_queue_params *queue;
 
        /* skip 'tx_queue_' prefix */
@@ -1936,7 +1936,7 @@ fail:
 
 static int hostapd_config_fill(struct hostapd_config *conf,
                               struct hostapd_bss_config *bss,
-                              char *buf, char *pos, int line)
+                              const char *buf, char *pos, int line)
 {
        if (os_strcmp(buf, "interface") == 0) {
                os_strlcpy(conf->bss[0]->iface, pos,
@@ -3481,7 +3481,8 @@ struct hostapd_config * hostapd_config_read(const char *fname)
 
 
 int hostapd_set_iface(struct hostapd_config *conf,
-                     struct hostapd_bss_config *bss, char *field, char *value)
+                     struct hostapd_bss_config *bss, const char *field,
+                     char *value)
 {
        int errors;
        size_t i;
index fba57b87ad7c605652c6f0a9d01c76c9b2e7cf61..c98bdb683ba109fd0fcb2776d11edd631383d2c5 100644 (file)
@@ -11,7 +11,7 @@
 
 struct hostapd_config * hostapd_config_read(const char *fname);
 int hostapd_set_iface(struct hostapd_config *conf,
-                     struct hostapd_bss_config *bss, char *field,
+                     struct hostapd_bss_config *bss, const char *field,
                      char *value);
 
 #endif /* CONFIG_FILE_H */
index 2fe8e560fc5d3e6fedb36f63dfc7efc47bbd0135..6be6c2ab5d3bdf98bb1b4059f0d937390c5a4b23 100644 (file)
@@ -2638,7 +2638,7 @@ hostapd_interfaces_get_hapd(struct hapd_interfaces *interfaces,
 
 static int hostapd_ctrl_iface_dup_param(struct hostapd_data *src_hapd,
                                        struct hostapd_data *dst_hapd,
-                                       char *param)
+                                       const char *param)
 {
        int res;
        char *value;