]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add more error messages
authorAlan T. DeKok <aland@freeradius.org>
Mon, 10 Feb 2025 19:27:39 +0000 (14:27 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 10 Feb 2025 19:27:39 +0000 (14:27 -0500)
src/lib/io/network.c

index 9c7f4c54b722cd39885a1ac1a8a7e1684ed4262b..26f576e7519401eaaf4344219a3b196234ad76e1 100644 (file)
@@ -403,7 +403,10 @@ int fr_network_listen_inject(fr_network_t *nr, fr_listen_t *li, uint8_t const *p
        /*
         *      Can't inject to injection-less destinations.
         */
-       if (!li->app_io->inject) return -1;
+       if (!li->app_io->inject) {
+               fr_strerror_const("Listener cannot accept injected packet");
+               return -1;
+       }
 
        /*
         *      Avoid a bounce through the event loop if we're being called from the network thread.
@@ -412,14 +415,17 @@ int fr_network_listen_inject(fr_network_t *nr, fr_listen_t *li, uint8_t const *p
                fr_network_socket_t *s;
 
                s = fr_rb_find(nr->sockets, &(fr_network_socket_t){ .listen = li });
-               if (!s) return -1;
+               if (!s) {
+                       fr_strerror_const("Listener was not found for injected packet");
+                       return -1;
+               }
 
                /*
                 *      Inject the packet.  The master.c mod_read() routine will then take care of avoiding
                 *      IO, and instead return the packet to the network side.
                 */
                if (li->app_io->inject(li, packet, packet_len, recv_time) == 0) {
-                       fr_network_read(nr->el, li->fd, 0, s);
+                       (void) fr_network_read(nr->el, li->fd, 0, s);
                }
 
                return 0;