diff options
author | sam <sam@FreeBSD.org> | 2008-03-24 21:06:16 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-03-24 21:06:16 +0000 |
commit | 66e67b92fee232a5ee45d03750cad85026828945 (patch) | |
tree | 78bf17cbe16912111a6c13e5b474634183b11be0 /contrib/hostapd/radius_client.c | |
parent | 1bf2fd00c50865c26197a0fb9ce70f417b9fa121 (diff) | |
download | FreeBSD-src-66e67b92fee232a5ee45d03750cad85026828945.zip FreeBSD-src-66e67b92fee232a5ee45d03750cad85026828945.tar.gz |
Import of hostapd 0.5.10
Diffstat (limited to 'contrib/hostapd/radius_client.c')
-rw-r--r-- | contrib/hostapd/radius_client.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/contrib/hostapd/radius_client.c b/contrib/hostapd/radius_client.c index 5b00bbe..81cd9c5 100644 --- a/contrib/hostapd/radius_client.c +++ b/contrib/hostapd/radius_client.c @@ -142,7 +142,8 @@ static void radius_client_handle_send_error(struct radius_client_data *radius, #ifndef CONFIG_NATIVE_WINDOWS int _errno = errno; perror("send[RADIUS]"); - if (_errno == ENOTCONN || _errno == EDESTADDRREQ || _errno == EINVAL) { + if (_errno == ENOTCONN || _errno == EDESTADDRREQ || _errno == EINVAL || + _errno == EBADF) { hostapd_logger(radius->ctx, NULL, HOSTAPD_MODULE_RADIUS, HOSTAPD_LEVEL_INFO, "Send failed - maybe interface status changed -" @@ -451,6 +452,13 @@ int radius_client_send(struct radius_client_data *radius, } if (msg_type == RADIUS_ACCT || msg_type == RADIUS_ACCT_INTERIM) { + if (conf->acct_server == NULL) { + hostapd_logger(radius->ctx, NULL, + HOSTAPD_MODULE_RADIUS, + HOSTAPD_LEVEL_INFO, + "No accounting server configured"); + return -1; + } shared_secret = conf->acct_server->shared_secret; shared_secret_len = conf->acct_server->shared_secret_len; radius_msg_finish_acct(msg, shared_secret, shared_secret_len); @@ -458,6 +466,13 @@ int radius_client_send(struct radius_client_data *radius, s = radius->acct_sock; conf->acct_server->requests++; } else { + if (conf->auth_server == NULL) { + hostapd_logger(radius->ctx, NULL, + HOSTAPD_MODULE_RADIUS, + HOSTAPD_LEVEL_INFO, + "No authentication server configured"); + return -1; + } shared_secret = conf->auth_server->shared_secret; shared_secret_len = conf->auth_server->shared_secret_len; radius_msg_finish(msg, shared_secret, shared_secret_len); |