From: Alan T. DeKok Date: Wed, 30 Apr 2025 18:21:42 +0000 (-0400) Subject: complain when no 'send foo' section is found for reply 'foo' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94a0f3069fd56260cd664db970c21c61d96d72d5;p=thirdparty%2Ffreeradius-server.git complain when no 'send foo' section is found for reply 'foo' However, this is not a fatal error. Arguably, it should be a compile-time error and not a run-time error. But it's hard to automatically correlate 'recv foo' with 'send reply-to-foo' as there can be many different kinds of replies. Having it a run-time error also means that the admin gets warned on every packet, which means that they are slightly more likely to read it and then do something about it. --- diff --git a/src/lib/server/process.h b/src/lib/server/process.h index 7ccb0e81e7..3734860e1b 100644 --- a/src/lib/server/process.h +++ b/src/lib/server/process.h @@ -317,7 +317,18 @@ SEND(generic) MEM(0); } - if (cs) RDEBUG("Running '%s %s' from file %s", cf_section_name1(cs), cf_section_name2(cs), cf_filename(cs)); + if (cs) { + RDEBUG("Running '%s %s' from file %s", cf_section_name1(cs), cf_section_name2(cs), cf_filename(cs)); + } else { + char const *name; + + name = fr_dict_enum_name_by_value(attr_packet_type, fr_box_uint32(request->reply->code)); + if (name) { + RWDEBUG("No 'send %s { ... } section was found.", name); + } else { + RWDEBUG("No 'send %u { ... } section was found.", request->reply->code); + } + } return unlang_module_yield_to_section(p_result, request, cs, state->rcode, state->resume,