|
@@ -1399,65 +1399,3 @@ int radius_client_get_mib(struct radius_client_data *radius, char *buf,
|
|
|
|
|
|
return count;
|
|
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;
|
|
|
|
-}
|
|
|