From fb1f1be95c0726139ceab7891c051e2d23348579 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Wed, 26 Apr 2023 10:03:20 -0400 Subject: [PATCH] add Error-Cause = Invalid EAP Packet (Ignored) when rejecting EAP packets in the pre-proxy stage --- src/modules/rlm_eap/rlm_eap.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/rlm_eap/rlm_eap.c b/src/modules/rlm_eap/rlm_eap.c index 874eecc4ef..efb9660464 100644 --- a/src/modules/rlm_eap/rlm_eap.c +++ b/src/modules/rlm_eap/rlm_eap.c @@ -573,6 +573,12 @@ static rlm_rcode_t CC_HINT(nonnull) mod_pre_proxy(void *instance, REQUEST *reque if ((vp->vp_octets[0] == 0) ||( vp->vp_octets[0] > 6)) { RDEBUG("EAP header byte zero has invalid value"); + + add_error_cause: + /* + * Invalid EAP packet (ignored) + */ + pair_make_reply("Error-Cause", "202", T_OP_EQ); return RLM_MODULE_REJECT; } @@ -591,7 +597,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_pre_proxy(void *instance, REQUEST *reque if (vp->vp_octets[4] > inst->max_eap_type) { RDEBUG("EAP method %u is too large", vp->vp_octets[4]); - return RLM_MODULE_REJECT; + goto add_error_cause; } return RLM_MODULE_NOOP; -- 2.47.3