From: Jouni Malinen Date: Sat, 28 Feb 2015 11:55:12 +0000 (+0200) Subject: Allow RADIUS server address to be replaced X-Git-Tag: hostap_2_4~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbee36e316186b53d5b9d97c2248f85120c40107;p=thirdparty%2Fhostap.git Allow RADIUS server address to be replaced The new hostapd parameters auth_server_addr_replace and acct_server_addr_replace can now be used to replace the configured IP address instead of adding a new RADIUS server. This is mainly useful for testing purposes where the address can be changed over control interface during AP operation. Signed-off-by: Jouni Malinen --- diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 9edbe6326..95f3bf26e 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -2199,6 +2199,15 @@ static int hostapd_config_fill(struct hostapd_config *conf, line, pos); return 1; } + } else if (bss->radius->auth_server && + os_strcmp(buf, "auth_server_addr_replace") == 0) { + if (hostapd_parse_ip_addr(pos, + &bss->radius->auth_server->addr)) { + wpa_printf(MSG_ERROR, + "Line %d: invalid IP address '%s'", + line, pos); + return 1; + } } else if (bss->radius->auth_server && os_strcmp(buf, "auth_server_port") == 0) { bss->radius->auth_server->port = atoi(pos); @@ -2224,6 +2233,15 @@ static int hostapd_config_fill(struct hostapd_config *conf, line, pos); return 1; } + } else if (bss->radius->acct_server && + os_strcmp(buf, "acct_server_addr_replace") == 0) { + if (hostapd_parse_ip_addr(pos, + &bss->radius->acct_server->addr)) { + wpa_printf(MSG_ERROR, + "Line %d: invalid IP address '%s'", + line, pos); + return 1; + } } else if (bss->radius->acct_server && os_strcmp(buf, "acct_server_port") == 0) { bss->radius->acct_server->port = atoi(pos);