diff options
author | sam <sam@FreeBSD.org> | 2005-06-13 17:00:32 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-06-13 17:00:32 +0000 |
commit | d1a1fd4aa94cd9c5cb443c4c1337f91c8c46fde0 (patch) | |
tree | 5b11e5f1130886853d82813087f4d19c53b3e668 /contrib/hostapd/radius_server.c | |
parent | 15d1673cd63b48b8c42d611ff8f1b3be6c6748bc (diff) | |
download | FreeBSD-src-d1a1fd4aa94cd9c5cb443c4c1337f91c8c46fde0.zip FreeBSD-src-d1a1fd4aa94cd9c5cb443c4c1337f91c8c46fde0.tar.gz |
stripped down import of hostapd 0.3.9
Approved by: re (dwhite)
Diffstat (limited to 'contrib/hostapd/radius_server.c')
-rw-r--r-- | contrib/hostapd/radius_server.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/hostapd/radius_server.c b/contrib/hostapd/radius_server.c index bfc784f..d62648f 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; } } |