RADIUS client: Fix server failover on return-to-primary on error case
If a connection with the primary server cannot be established, restore connection to the previously used server. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
7c5658c661
commit
b4a9292cfb
1 changed files with 16 additions and 6 deletions
|
@ -1176,18 +1176,28 @@ static void radius_retry_primary_timer(void *eloop_ctx, void *timeout_ctx)
|
||||||
conf->auth_server != conf->auth_servers) {
|
conf->auth_server != conf->auth_servers) {
|
||||||
oserv = conf->auth_server;
|
oserv = conf->auth_server;
|
||||||
conf->auth_server = conf->auth_servers;
|
conf->auth_server = conf->auth_servers;
|
||||||
radius_change_server(radius, conf->auth_server, oserv,
|
if (radius_change_server(radius, conf->auth_server, oserv,
|
||||||
radius->auth_serv_sock,
|
radius->auth_serv_sock,
|
||||||
radius->auth_serv_sock6, 1);
|
radius->auth_serv_sock6, 1) < 0) {
|
||||||
|
conf->auth_server = oserv;
|
||||||
|
radius_change_server(radius, oserv, conf->auth_server,
|
||||||
|
radius->auth_serv_sock,
|
||||||
|
radius->auth_serv_sock6, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radius->acct_sock >= 0 && conf->acct_servers &&
|
if (radius->acct_sock >= 0 && conf->acct_servers &&
|
||||||
conf->acct_server != conf->acct_servers) {
|
conf->acct_server != conf->acct_servers) {
|
||||||
oserv = conf->acct_server;
|
oserv = conf->acct_server;
|
||||||
conf->acct_server = conf->acct_servers;
|
conf->acct_server = conf->acct_servers;
|
||||||
radius_change_server(radius, conf->acct_server, oserv,
|
if (radius_change_server(radius, conf->acct_server, oserv,
|
||||||
radius->acct_serv_sock,
|
radius->acct_serv_sock,
|
||||||
radius->acct_serv_sock6, 0);
|
radius->acct_serv_sock6, 0) < 0) {
|
||||||
|
conf->acct_server = oserv;
|
||||||
|
radius_change_server(radius, oserv, conf->acct_server,
|
||||||
|
radius->acct_serv_sock,
|
||||||
|
radius->acct_serv_sock6, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conf->retry_primary_interval)
|
if (conf->retry_primary_interval)
|
||||||
|
|
Loading…
Reference in a new issue