3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

eap: allow to discard EAP-Success/EAP-Failure pkts

This commit is contained in:
Tim Kourt 2018-02-23 09:48:44 -08:00 committed by Denis Kenzior
parent ad94752170
commit 97980c0315
2 changed files with 12 additions and 0 deletions

View File

@ -49,6 +49,8 @@ struct eap_state {
void *method_state;
bool method_success;
struct l_timeout *complete_timeout;
bool discard_success_and_failure:1;
};
struct eap_state *eap_new(eap_tx_packet_func_t tx_packet,
@ -287,6 +289,9 @@ void eap_rx_packet(struct eap_state *eap, const uint8_t *pkt, size_t len)
case EAP_CODE_FAILURE:
case EAP_CODE_SUCCESS:
if (eap->discard_success_and_failure)
return;
l_timeout_remove(eap->complete_timeout);
eap->complete_timeout = NULL;
@ -448,6 +453,11 @@ void eap_method_success(struct eap_state *eap)
eap->method_success = true;
}
void eap_discard_success_and_failure(struct eap_state *eap, bool discard)
{
eap->discard_success_and_failure = discard;
}
void eap_method_error(struct eap_state *eap)
{
/*

View File

@ -62,6 +62,8 @@ void eap_rx_packet(struct eap_state *eap, const uint8_t *pkt, size_t len);
void __eap_handle_request(struct eap_state *eap, uint16_t id,
const uint8_t *pkt, size_t len);
void eap_discard_success_and_failure(struct eap_state *eap, bool discard);
void eap_init(uint32_t default_mtu);
void eap_exit(void);