aboutsummaryrefslogtreecommitdiff
path: root/contrib/hostapd/radius_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/hostapd/radius_server.c')
-rw-r--r--contrib/hostapd/radius_server.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/hostapd/radius_server.c b/contrib/hostapd/radius_server.c
index bfc784f4759a..d62648f896b1 100644
--- a/contrib/hostapd/radius_server.c
+++ b/contrib/hostapd/radius_server.c
@@ -325,6 +325,7 @@ static int radius_server_reject(struct radius_server_data *data,
{
struct radius_msg *msg;
int ret = 0;
+ struct eap_hdr eapfail;
RADIUS_DEBUG("Reject invalid request from %s:%d",
inet_ntoa(from->sin_addr), ntohs(from->sin_port));
@@ -335,6 +336,16 @@ static int radius_server_reject(struct radius_server_data *data,
return -1;
}
+ memset(&eapfail, 0, sizeof(eapfail));
+ eapfail.code = EAP_CODE_FAILURE;
+ eapfail.identifier = 0;
+ eapfail.length = htons(sizeof(eapfail));
+
+ if (!radius_msg_add_eap(msg, (u8 *) &eapfail, sizeof(eapfail))) {
+ RADIUS_DEBUG("Failed to add EAP-Message attribute");
+ }
+
+
if (radius_msg_finish_srv(msg, (u8 *) client->shared_secret,
client->shared_secret_len,
request->hdr->authenticator) < 0) {
@@ -395,6 +406,7 @@ static int radius_server_request(struct radius_server_data *data,
sess = radius_server_get_new_session(data, client, msg);
if (sess == NULL) {
RADIUS_DEBUG("Could not create a new session");
+ radius_server_reject(data, client, msg, from);
return -1;
}
}