]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove unused RADIUS client reconfig function
authorJouni Malinen <j@w1.fi>
Sat, 28 Nov 2009 21:04:35 +0000 (23:04 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 28 Nov 2009 21:04:35 +0000 (23:04 +0200)
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.

src/radius/radius_client.c
src/radius/radius_client.h

index 592e4aa31422742ba607fc021e9abcbc1cf3b3fb..ec38c0df94b5273fc6a9fce80c36a221141291d3 100644 (file)
@@ -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;
-}
index eb81234c6dd6f3d9c2509f68111e63199d6f518c..796b0e11ce9997876ad56800ae22b713118360fc 100644 (file)
@@ -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 */