diff options
author | Jouni Malinen <j@w1.fi> | 2009-11-28 23:04:35 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2009-11-28 23:04:35 +0200 |
commit | 93704f8f95d4fd417f34165fbb6be87ce2a4c53c (patch) | |
tree | c2f5b8987a569ecd7d40f99a749747ae43650b8d /src/radius | |
parent | 5843e1c9a6930dcca3ea3837b0b0b0e09e73262f (diff) | |
download | external_wpa_supplicant_8_ti-93704f8f95d4fd417f34165fbb6be87ce2a4c53c.zip external_wpa_supplicant_8_ti-93704f8f95d4fd417f34165fbb6be87ce2a4c53c.tar.gz external_wpa_supplicant_8_ti-93704f8f95d4fd417f34165fbb6be87ce2a4c53c.tar.bz2 |
Remove unused RADIUS client reconfig function
This is not actually used at all and it looks like the rules for
maintaining the old/new RADIUS configuration are not very clear in the
case the RADIUS client configuration did not change. Consequently, it
is better to just remove this for now and if similar functionality is
ever needed, redesign it to be easier to use without causing hard to
find issues with using freed memory.
Simpler approach to reconfiguring the RADIUS client would involve
just deinitializing the old context unconditionally and initializing
a new one whenever the configuration could have changed.
Diffstat (limited to 'src/radius')
-rw-r--r-- | src/radius/radius_client.c | 62 | ||||
-rw-r--r-- | src/radius/radius_client.h | 4 |
2 files changed, 0 insertions, 66 deletions
diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c index 592e4aa..ec38c0d 100644 --- a/src/radius/radius_client.c +++ b/src/radius/radius_client.c @@ -1399,65 +1399,3 @@ int radius_client_get_mib(struct radius_client_data *radius, char *buf, return count; } - - -static int radius_servers_diff(struct hostapd_radius_server *nserv, - struct hostapd_radius_server *oserv, - int num) -{ - int i; - - for (i = 0; i < num; i++) { - if (hostapd_ip_diff(&nserv[i].addr, &oserv[i].addr) || - nserv[i].port != oserv[i].port || - nserv[i].shared_secret_len != oserv[i].shared_secret_len || - os_memcmp(nserv[i].shared_secret, oserv[i].shared_secret, - nserv[i].shared_secret_len) != 0) - return 1; - } - - return 0; -} - - -/** - * radius_client_reconfig - Reconfigure RADIUS client - * @old: RADIUS client context from radius_client_init() - * @ctx: Callback context to be used in hostapd_logger() calls - * @oldconf: Old RADIUS client configuration (RADIUS servers) - * @newconf: New RADIUS client configuration (RADIUS servers) - * Returns: Pointer to private RADIUS client context or %NULL on failure - * - * This function can be used to conditionally change RADIUS client - * configuration. If newconf differs from oldconf, the old RADIUS client - * context is deinitialized and new one is allocated. If there is no change in - * the configuration, the old RADIUS client context will be returned. - * - * The caller is responsible for keeping the new configuration data available - * for the lifetime of the RADIUS client, i.e., until radius_client_deinit() is - * called for the returned context pointer. - */ -struct radius_client_data * -radius_client_reconfig(struct radius_client_data *old, void *ctx, - struct hostapd_radius_servers *oldconf, - struct hostapd_radius_servers *newconf) -{ - radius_client_flush(old, 0); - - if (newconf->retry_primary_interval != - oldconf->retry_primary_interval || - newconf->num_auth_servers != oldconf->num_auth_servers || - newconf->num_acct_servers != oldconf->num_acct_servers || - radius_servers_diff(newconf->auth_servers, oldconf->auth_servers, - newconf->num_auth_servers) || - radius_servers_diff(newconf->acct_servers, oldconf->acct_servers, - newconf->num_acct_servers)) { - hostapd_logger(ctx, NULL, HOSTAPD_MODULE_RADIUS, - HOSTAPD_LEVEL_DEBUG, - "Reconfiguring RADIUS client"); - radius_client_deinit(old); - return radius_client_init(ctx, newconf); - } - - return old; -} diff --git a/src/radius/radius_client.h b/src/radius/radius_client.h index eb81234..796b0e1 100644 --- a/src/radius/radius_client.h +++ b/src/radius/radius_client.h @@ -267,9 +267,5 @@ void radius_client_flush_auth(struct radius_client_data *radius, int radius_client_get_mib(struct radius_client_data *radius, char *buf, size_t buflen); #endif /* CONFIG_NO_RADIUS */ -struct radius_client_data * -radius_client_reconfig(struct radius_client_data *old, void *ctx, - struct hostapd_radius_servers *oldconf, - struct hostapd_radius_servers *newconf); #endif /* RADIUS_CLIENT_H */ |