]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
warn if Original-Packet-Code is missing
authorAlan T. DeKok <aland@freeradius.org>
Sat, 1 Nov 2025 19:26:12 +0000 (15:26 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 1 Nov 2025 21:25:18 +0000 (17:25 -0400)
and delete it if we see it

src/modules/rlm_radius/bio.c

index a41fe7ce05a43502756f522514f5bcfaeec08260..aa4a6355d777b894ef242000c24bbc207c0a41c9 100644 (file)
@@ -2134,7 +2134,13 @@ static void request_demux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
                switch (code) {
                case FR_RADIUS_CODE_PROTOCOL_ERROR:
                        protocol_error_reply(u, h);
-                       fr_pair_delete_by_da(&request->reply_pairs, NULL, attr_original_packet_code);
+
+                       vp = fr_pair_find_by_da(&request->reply_pairs, NULL, attr_original_packet_code);
+                       if (!vp) {
+                               RWDEBUG("Protocol-Error response is missing Original-Packet-Code");
+                       } else {
+                               fr_pair_delete_by_da(&request->reply_pairs, attr_original_packet_code);
+                       }
 
                        vp = fr_pair_find_by_da(&request->reply_pairs, NULL, attr_error_cause);
                        if (!vp) {