diff options
author | Chia-chi Yeh <chiachi@android.com> | 2010-01-29 00:22:32 +0800 |
---|---|---|
committer | Chia-chi Yeh <chiachi@android.com> | 2010-01-29 00:22:32 +0800 |
commit | f4fc3fbe982b67b82b143384bd5e7330d4202eca (patch) | |
tree | 97f3fe83221e54924d9d59f6c76edcafbe59bd0b | |
parent | eb26c9627ca1cf7315f2eff0454114c81874fc92 (diff) | |
download | wpa_supplicant-f4fc3fbe982b67b82b143384bd5e7330d4202eca.tar.gz |
wpa_supplicant: extend set_network to allow string variables to be unset.
To unset a variable, use NULL without quotation as the value in set_network.
Back ported from wpa_supplicant 0.6.x b56c0546b7e46f221d751ef7390fbfec607254e2.
-rw-r--r-- | config.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -91,6 +91,14 @@ static int wpa_config_parse_str(const struct parse_data *data, size_t res_len, *dst_len; char **dst, *tmp; + if (os_strcmp(value, "NULL") == 0) { + wpa_printf(MSG_DEBUG, "Unset configuration string '%s'", + data->name); + tmp = NULL; + res_len = 0; + goto set; + } + tmp = wpa_config_parse_string(value, &res_len); if (tmp == NULL) { wpa_printf(MSG_ERROR, "Line %d: failed to parse %s '%s'.", @@ -123,6 +131,7 @@ static int wpa_config_parse_str(const struct parse_data *data, return -1; } +set: dst = (char **) (((u8 *) ssid) + (long) data->param1); dst_len = (size_t *) (((u8 *) ssid) + (long) data->param2); os_free(*dst); |