]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add option to allow for non-socket listeners
authorNick Porter <nick@portercomputing.co.uk>
Tue, 17 Oct 2023 10:11:59 +0000 (11:11 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 18 Oct 2023 10:19:09 +0000 (11:19 +0100)
src/lib/io/listen.h
src/lib/io/network.c

index d8bd275a871c4c01a6b1856f686b94e54c19c210..821362ff7bc4e107e0e6fc7f10c2c9e4f187fc76 100644 (file)
@@ -42,6 +42,7 @@ struct fr_listen {
        bool                    connected;              //!< is this for a connected socket?
        bool                    track_duplicates;       //!< do we track duplicate packets?
        bool                    no_write_callback;      //!< sometimes we don't need to do writes
+       bool                    non_socket_listener;    //!< special internal listener that does not use sockets.
 
        size_t                  default_message_size;   //!< copied from app_io, but may be changed
        size_t                  num_messages;           //!< for the message ring buffer
index 529f731c7c9c9f22dd7655b7f73437420afeda14..9b4da2e304db500fda88f7e0a5edcfc50947b9d8 100644 (file)
@@ -1320,7 +1320,7 @@ static int fr_network_listen_add_self(fr_network_t *nr, fr_listen_t *listen)
         *      have a close, so look for both open and close to
         *      determine what this is.
         */
-       if (!listen->app_io->open && !listen->app_io->close) {
+       if (listen->non_socket_listener || (!listen->app_io->open && !listen->app_io->close)) {
                fr_assert(listen->app_io->event_list_set != NULL);
                fr_assert(!listen->app_io->read);
                fr_assert(!listen->app_io->write);