]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Delete packet type when overriding the reply code
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 15 Sep 2021 17:26:34 +0000 (12:26 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 15 Sep 2021 17:26:34 +0000 (12:26 -0500)
src/lib/server/process.h

index d2be7b7459f886cc3281ee39751812f34faea4d6..b54cfcb5532168c72b43cdd4124b99ee750096b2 100644 (file)
@@ -129,14 +129,26 @@ static fr_process_state_t const process_state[];
  */
 #define CALL_RESUME(_x) resume_ ## _x(p_result, mctx, request, rctx)
 
-/** Set the current reply code, and call the send function for that state
- */
-#define CALL_SEND_TYPE(_x) process_state[(request->reply->code = _x)].send(p_result, mctx, request, rctx)
-
 /** Call the send function for the current state
  */
 #define CALL_SEND_STATE(_state) state->send(p_result, mctx, request, rctx)
 
+/** Set the current reply code, and call the send function for that state
+ */
+#define CALL_SEND_TYPE(_x) call_send_type(process_state[(request->reply->code = _x)].send, p_result, mctx, request, rctx)
+
+static inline unlang_action_t call_send_type(unlang_module_resume_t send, \
+                                            rlm_rcode_t *p_result, module_ctx_t const *mctx,
+                                            request_t *request, void *rctx)
+{
+       /*
+        *      Stupid hack to stop this being honoured
+        *      by send_generic.
+        */
+       pair_delete_reply(attr_packet_type);
+       return send(p_result, mctx, request, rctx);
+}
+
 RECV(generic)
 {
        CONF_SECTION                    *cs;