diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2015-11-26 15:26:42 +0100 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2015-11-26 15:26:42 +0100 |
commit | f42f239a632306ed082f6fde878977248eea85cf (patch) | |
tree | 6b6f55133d62cd206d1ad487c28215386bfae75c /src/libcharon | |
parent | 6f35bf8f3833c3530d0ccec0f68bee97d0f00ebe (diff) | |
download | vyos-strongswan-f42f239a632306ed082f6fde878977248eea85cf.tar.gz vyos-strongswan-f42f239a632306ed082f6fde878977248eea85cf.zip |
Imported Upstream version 5.3.5
Diffstat (limited to 'src/libcharon')
-rw-r--r-- | src/libcharon/plugins/eap_radius/eap_radius_plugin.c | 60 |
1 files changed, 58 insertions, 2 deletions
diff --git a/src/libcharon/plugins/eap_radius/eap_radius_plugin.c b/src/libcharon/plugins/eap_radius/eap_radius_plugin.c index 6a4a0384e..4fe982849 100644 --- a/src/libcharon/plugins/eap_radius/eap_radius_plugin.c +++ b/src/libcharon/plugins/eap_radius/eap_radius_plugin.c @@ -14,6 +14,28 @@ * for more details. */ +/* + * Copyright (C) 2015 Thom Troy + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + #include "eap_radius_plugin.h" #include "eap_radius.h" @@ -98,6 +120,8 @@ static void load_configs(private_eap_radius_plugin_t *this) radius_config_t *config; char *nas_identifier, *secret, *address, *section; int auth_port, acct_port, sockets, preference; + u_int retransmit_tries; + double retransmit_timeout, retransmit_base; address = lib->settings->get_str(lib->settings, "%s.plugins.eap-radius.server", NULL, lib->ns); @@ -117,8 +141,18 @@ static void load_configs(private_eap_radius_plugin_t *this) "%s.plugins.eap-radius.port", AUTH_PORT, lib->ns); sockets = lib->settings->get_int(lib->settings, "%s.plugins.eap-radius.sockets", 1, lib->ns); + + retransmit_tries = lib->settings->get_int(lib->settings, + "%s.plugins.eap-radius.retransmit_tries", 4, lib->ns); + retransmit_timeout = lib->settings->get_double(lib->settings, + "%s.plugins.eap-radius.retransmit_timeout", 2, lib->ns); + retransmit_base = lib->settings->get_double(lib->settings, + "%s.plugins.eap-radius.retransmit_base", 1.4, lib->ns); + config = radius_config_create(address, address, auth_port, ACCT_PORT, - nas_identifier, secret, sockets, 0); + nas_identifier, secret, sockets, 0, + retransmit_tries, retransmit_timeout, + retransmit_base); if (!config) { DBG1(DBG_CFG, "no RADUIS server defined"); @@ -170,11 +204,33 @@ static void load_configs(private_eap_radius_plugin_t *this) lib->settings->get_int(lib->settings, "%s.plugins.eap-radius.sockets", 1, lib->ns), lib->ns, section); + + retransmit_tries = lib->settings->get_int(lib->settings, + "%s.plugins.eap-radius.servers.%s.retransmit_tries", + lib->settings->get_int(lib->settings, + "%s.plugins.eap-radius.retransmit_tries", 4, lib->ns), + lib->ns, section); + + retransmit_timeout = lib->settings->get_double(lib->settings, + "%s.plugins.eap-radius.servers.%s.retransmit_timeout", + lib->settings->get_double(lib->settings, + "%s.plugins.eap-radius.retransmit_timeout", 2, lib->ns), + lib->ns, section); + + retransmit_base = lib->settings->get_double(lib->settings, + "%s.plugins.eap-radius.servers.%s.retransmit_base", + lib->settings->get_double(lib->settings, + "%s.plugins.eap-radius.retransmit_base", 1.4, lib->ns), + lib->ns, section); + preference = lib->settings->get_int(lib->settings, "%s.plugins.eap-radius.servers.%s.preference", 0, lib->ns, section); + config = radius_config_create(section, address, auth_port, acct_port, - nas_identifier, secret, sockets, preference); + nas_identifier, secret, sockets, preference, + retransmit_tries, retransmit_timeout, + retransmit_base); if (!config) { DBG1(DBG_CFG, "loading RADIUS server '%s' failed, skipped", section); |