]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
complain when no 'send foo' section is found for reply 'foo'
authorAlan T. DeKok <aland@freeradius.org>
Wed, 30 Apr 2025 18:21:42 +0000 (14:21 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 30 Apr 2025 18:53:45 +0000 (14:53 -0400)
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.

src/lib/server/process.h

index 7ccb0e81e7322e2d07fcc957e5f9a674e968b6f5..3734860e1b8e1538e313bae078b798a3c13ac7dd 100644 (file)
@@ -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,