]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add "ef_out" to fr_event_fd_insert()
authorAlan T. DeKok <aland@freeradius.org>
Sun, 31 Mar 2024 14:53:20 +0000 (10:53 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 31 Mar 2024 14:53:43 +0000 (10:53 -0400)
25 files changed:
src/bin/radsniff.c
src/lib/curl/io.c
src/lib/io/control.c
src/lib/io/network.c
src/lib/ldap/bind.c
src/lib/ldap/connection.c
src/lib/ldap/sasl.c
src/lib/ldap/start_tls.c
src/lib/redis/io.c
src/lib/server/connection.c
src/lib/server/exec.c
src/lib/server/main_loop.c
src/lib/server/trunk_tests.c
src/lib/unlang/module.c
src/lib/util/event.c
src/lib/util/event.h
src/lib/util/log.c
src/lib/util/udp_queue.c
src/listen/ldap_sync/proto_ldap_sync_ldap.c
src/modules/rlm_icmp/rlm_icmp.c
src/modules/rlm_logtee/rlm_logtee.c
src/modules/rlm_radius/rlm_radius_udp.c
src/modules/rlm_sigtran/client.c
src/modules/rlm_tacacs/rlm_tacacs_tcp.c
src/modules/rlm_unbound/io.c

index b3826ae5426d353b3a5cfb93caf254e1b3e872be..fa4685a91cd335aba0207ccc7d0be898d5eaef9a 100644 (file)
@@ -3055,7 +3055,7 @@ int main(int argc, char *argv[])
                        fr_exit_now(EXIT_FAILURE);
                }
 
-               if (fr_event_fd_insert(NULL, events, self_pipe[0],
+               if (fr_event_fd_insert(NULL, NULL, events, self_pipe[0],
                                       rs_signal_action,
                                       NULL,
                                       NULL,
@@ -3102,7 +3102,7 @@ int main(int argc, char *argv[])
                         */
                        if (event->in->type == PCAP_FILE_IN) {
                                rs_got_packet(events, in_p->fd, 0, event);
-                       } else if (fr_event_fd_insert(NULL, events, in_p->fd,
+                       } else if (fr_event_fd_insert(NULL, NULL, events, in_p->fd,
                                               rs_got_packet,
                                               NULL,
                                               NULL,
index b1cba5fa6860c1899b3f96af14cb8f3e04687a31..64e2a30adc41d96cd08d271bf1d8fbc19ba29eda 100644 (file)
@@ -319,7 +319,7 @@ static int _fr_curl_io_event_modify(UNUSED CURL *easy, curl_socket_t fd, int wha
 
        switch (what) {
        case CURL_POLL_IN:
-               if (fr_event_fd_insert(mhandle, mhandle->el, fd,
+               if (fr_event_fd_insert(mhandle, NULL, mhandle->el, fd,
                                       _fr_curl_io_service_readable,
                                       NULL,
                                       _fr_curl_io_service_errored,
@@ -332,7 +332,7 @@ static int _fr_curl_io_event_modify(UNUSED CURL *easy, curl_socket_t fd, int wha
                break;
 
        case CURL_POLL_OUT:
-               if (fr_event_fd_insert(mhandle, mhandle->el, fd,
+               if (fr_event_fd_insert(mhandle, NULL, mhandle->el, fd,
                                       NULL,
                                       _fr_curl_io_service_writable,
                                       _fr_curl_io_service_errored,
@@ -345,7 +345,7 @@ static int _fr_curl_io_event_modify(UNUSED CURL *easy, curl_socket_t fd, int wha
                break;
 
        case CURL_POLL_INOUT:
-               if (fr_event_fd_insert(mhandle, mhandle->el, fd,
+               if (fr_event_fd_insert(mhandle, NULL, mhandle->el, fd,
                                       _fr_curl_io_service_readable,
                                       _fr_curl_io_service_writable,
                                       _fr_curl_io_service_errored,
index 3e0137af38ef8672384e0bd4727f52e49481c807..5f3de7e110fe4b8d0ec8f5b1041450db4d9dc70b 100644 (file)
@@ -171,7 +171,7 @@ fr_control_t *fr_control_create(TALLOC_CTX *ctx, fr_event_list_t *el, fr_atomic_
        (void) fcntl(c->pipe[0], F_SETFL, O_NONBLOCK | FD_CLOEXEC);
        (void) fcntl(c->pipe[1], F_SETFL, O_NONBLOCK | FD_CLOEXEC);
 
-       if (fr_event_fd_insert(c, el, c->pipe[0], pipe_read, NULL, NULL, c) < 0) {
+       if (fr_event_fd_insert(c, NULL, el, c->pipe[0], pipe_read, NULL, NULL, c) < 0) {
                talloc_free(c);
                fr_strerror_const_push("Failed adding FD to event list control socket");
                return NULL;
index 3cfc9e2888955743cab9286a29cade1511c79bbd..8d77c0efb30c2b28881d7665e14a33317eb63141 100644 (file)
@@ -1371,7 +1371,7 @@ static int fr_network_listen_add_self(fr_network_t *nr, fr_listen_t *listen)
        app_io = s->listen->app_io;
        s->filter = FR_EVENT_FILTER_IO;
 
-       if (fr_event_fd_insert(nr, nr->el, s->listen->fd,
+       if (fr_event_fd_insert(nr, NULL, nr->el, s->listen->fd,
                               fr_network_read,
                               s->listen->no_write_callback ? NULL : fr_network_write,
                               fr_network_error,
@@ -1979,7 +1979,7 @@ fr_network_t *fr_network_create(TALLOC_CTX *ctx, fr_event_list_t *el, char const
        if (fr_nonblock(nr->signal_pipe[0]) < 0) goto fail2;
        if (fr_nonblock(nr->signal_pipe[1]) < 0) goto fail2;
 
-       if (fr_event_fd_insert(nr, nr->el, nr->signal_pipe[0], _signal_pipe_read, NULL, NULL, nr) < 0) {
+       if (fr_event_fd_insert(nr, NULL, nr->el, nr->signal_pipe[0], _signal_pipe_read, NULL, NULL, nr) < 0) {
                fr_strerror_const("Failed inserting event for signal pipe");
                goto fail2;
        }
index 03fd81bd495815b6abc4ae65b0dc2489e5384e3a..ee3de78a0434a07b733bc1a5f9aa8228d54f3a06 100644 (file)
@@ -141,7 +141,7 @@ static void _ldap_bind_io_write(fr_event_list_t *el, int fd, UNUSED int flags, v
                        return;
                }
 
-               ret = fr_event_fd_insert(bind_ctx, el, fd,
+               ret = fr_event_fd_insert(bind_ctx, NULL, el, fd,
                                         NULL,
                                         _ldap_bind_io_write,   /* We'll be called again when the conn is open */
                                         _ldap_bind_io_error,
@@ -155,7 +155,7 @@ static void _ldap_bind_io_write(fr_event_list_t *el, int fd, UNUSED int flags, v
                        if ((ret != LDAP_OPT_SUCCESS) || (fd < 0)) goto error;
                }
                c->fd = fd;
-               ret = fr_event_fd_insert(bind_ctx, el, fd,
+               ret = fr_event_fd_insert(bind_ctx, NULL, el, fd,
                                         _ldap_bind_io_read,
                                         NULL,
                                         _ldap_bind_io_error,
@@ -212,7 +212,7 @@ int fr_ldap_bind_async(fr_ldap_connection_t *c,
        if ((ldap_get_option(c->handle, LDAP_OPT_DESC, &fd) == LDAP_SUCCESS) && (fd >= 0)) {
                int ret;
 
-               ret = fr_event_fd_insert(bind_ctx, el, fd,
+               ret = fr_event_fd_insert(bind_ctx, NULL, el, fd,
                                         NULL,
                                         _ldap_bind_io_write,
                                         _ldap_bind_io_error,
index 13c6aad66dec2bd1dc64f9269a4159c90a287198..a64332c312ea253fe014ca336fab6a3c6f5dd2fb 100644 (file)
@@ -610,7 +610,7 @@ static void ldap_trunk_connection_notify(fr_trunk_connection_t *tconn, fr_connec
                break;
        }
 
-       if (fr_event_fd_insert(ldap_conn, el, ldap_conn->fd,
+       if (fr_event_fd_insert(ldap_conn, NULL, el, ldap_conn->fd,
                               read_fn,
                               write_fn,
                               ldap_conn_error,
index 1ae0ed9f7aac82f35fe376a71ab6dd3274d10b5d..9e47a36b4831a43cc746ca7ddb730866cdede49a 100644 (file)
@@ -175,7 +175,7 @@ static void _ldap_sasl_bind_io_read(fr_event_list_t *el, int fd, UNUSED int flag
                 */
                if (sasl_ctx->rmech) DEBUG3("Continuing SASL mech %s...", sasl_ctx->rmech);
 
-               ret = fr_event_fd_insert(sasl_ctx, el, fd,
+               ret = fr_event_fd_insert(sasl_ctx, NULL, el, fd,
                                         NULL,
                                         _ldap_sasl_bind_io_write,      /* Need to write more SASL stuff */
                                         _ldap_sasl_bind_io_error,
@@ -238,7 +238,7 @@ static void _ldap_sasl_bind_io_write(fr_event_list_t *el, int fd, UNUSED int fla
                        return;
                }
 
-               ret = fr_event_fd_insert(sasl_ctx, el, fd,
+               ret = fr_event_fd_insert(sasl_ctx, NULL, el, fd,
                                         NULL,
                                         _ldap_sasl_bind_io_write,      /* We'll be called again when the conn is open */
                                         _ldap_sasl_bind_io_error,
@@ -255,7 +255,7 @@ static void _ldap_sasl_bind_io_write(fr_event_list_t *el, int fd, UNUSED int fla
                        if ((ret != LDAP_OPT_SUCCESS) || (fd < 0)) goto error;
                }
                c->fd = fd;
-               ret = fr_event_fd_insert(sasl_ctx, el, fd,
+               ret = fr_event_fd_insert(sasl_ctx, NULL, el, fd,
                                         _ldap_sasl_bind_io_read,
                                         NULL,
                                         _ldap_sasl_bind_io_error,
@@ -340,7 +340,7 @@ int fr_ldap_sasl_bind_async(fr_ldap_connection_t *c,
        if ((ldap_get_option(c->handle, LDAP_OPT_DESC, &fd) == LDAP_SUCCESS) && (fd >= 0)){
                int ret;
 
-               ret = fr_event_fd_insert(sasl_ctx, el, fd,
+               ret = fr_event_fd_insert(sasl_ctx, NULL, el, fd,
                                         NULL,
                                         _ldap_sasl_bind_io_write,
                                         _ldap_sasl_bind_io_error,
index 76fd4578370e446252e81245134558c122268721..527ba041343b8d0c06061207fc2e4770af26371e 100644 (file)
@@ -179,7 +179,7 @@ static void _ldap_start_tls_io_write(fr_event_list_t *el, int fd, UNUSED int fla
                        return;
                }
 
-               ret = fr_event_fd_insert(tls_ctx, el, fd,
+               ret = fr_event_fd_insert(tls_ctx, NULL, el, fd,
                                         NULL,
                                         _ldap_start_tls_io_write,      /* We'll be called again when the conn is open */
                                         _ldap_start_tls_io_error,
@@ -193,7 +193,7 @@ static void _ldap_start_tls_io_write(fr_event_list_t *el, int fd, UNUSED int fla
                        if ((ret != LDAP_OPT_SUCCESS) || (fd < 0)) goto error;
                }
                c->fd = fd;
-               ret = fr_event_fd_insert(tls_ctx, el, fd,
+               ret = fr_event_fd_insert(tls_ctx, NULL, el, fd,
                                         _ldap_start_tls_io_read,
                                         NULL,
                                         _ldap_start_tls_io_error,
@@ -241,7 +241,7 @@ int fr_ldap_start_tls_async(fr_ldap_connection_t *c, LDAPControl **serverctrls,
        if ((ldap_get_option(c->handle, LDAP_OPT_DESC, &fd) == LDAP_SUCCESS) && (fd >= 0)) {
                int ret;
 
-               ret = fr_event_fd_insert(tls_ctx, el, fd,
+               ret = fr_event_fd_insert(tls_ctx, NULL, el, fd,
                                         NULL,
                                         _ldap_start_tls_io_write,
                                         _ldap_start_tls_io_error,
index 4ba1b7801a49dfcab1ff47c1413501c362174d81..8cebe08fc00ccbefc09327065594498db07010c5 100644 (file)
@@ -135,7 +135,7 @@ static void _redis_io_common(fr_connection_t *conn, fr_redis_handle_t *h, bool r
        DEBUG4("redis handle %p - Registered for %s%serror events on FD %i",
               h, read ? "read+" : "", write ? "write+" : "", c->fd);
 
-       if (fr_event_fd_insert(h, el, c->fd,
+       if (fr_event_fd_insert(h, NULL, el, c->fd,
                               read ? _redis_io_service_readable : NULL,
                               write ? _redis_io_service_writable : NULL,
                               _redis_io_service_errored,
index 089d7ee1999465493dc21471d194599caea6e672..bb0103faab76e79d3cecf1da45086b4afc1a8708 100644 (file)
@@ -1405,7 +1405,7 @@ int fr_connection_signal_on_fd(fr_connection_t *conn, int fd)
         *      If connection becomes writable we
         *      assume it's open.
         */
-       if (fr_event_fd_insert(conn, conn->pub.el, fd,
+       if (fr_event_fd_insert(conn, NULL, conn->pub.el, fd,
                               NULL,
                               _connection_writable,
                               _connection_error,
index d9507b3da464c677de8e9e5d45add411f02055f7..c32377b47d41e19fd92ea59479c6839c11b98b90 100644 (file)
@@ -1059,7 +1059,7 @@ int fr_exec_oneshot(TALLOC_CTX *ctx, fr_exec_state_t *exec, request_t *request,
                 *      Accept a maximum of 32k of data from the process.
                 */
                fr_sbuff_init_talloc(exec->stdout_ctx, &exec->stdout_buff, &exec->stdout_tctx, 128, 32 * 1024);
-               if (fr_event_fd_insert(ctx, el, exec->stdout_fd, exec_stdout_read, NULL, NULL, exec) < 0) {
+               if (fr_event_fd_insert(ctx, NULL, el, exec->stdout_fd, exec_stdout_read, NULL, NULL, exec) < 0) {
                        RPEDEBUG("Failed adding event listening to stdout");
                        goto fail_and_close;
                }
@@ -1077,7 +1077,7 @@ int fr_exec_oneshot(TALLOC_CTX *ctx, fr_exec_state_t *exec, request_t *request,
                        .prefix = exec->stdout_prefix
                };
 
-               if (fr_event_fd_insert(ctx, el, exec->stdout_fd, log_request_fd_event,
+               if (fr_event_fd_insert(ctx, NULL, el, exec->stdout_fd, log_request_fd_event,
                                       NULL, NULL, &exec->stdout_uctx) < 0){
                        RPEDEBUG("Failed adding event listening to stdout");
                        goto fail_and_close;
@@ -1095,7 +1095,7 @@ int fr_exec_oneshot(TALLOC_CTX *ctx, fr_exec_state_t *exec, request_t *request,
                .prefix = exec->stderr_prefix
        };
 
-       if (fr_event_fd_insert(ctx, el, exec->stderr_fd, log_request_fd_event,
+       if (fr_event_fd_insert(ctx, NULL, el, exec->stderr_fd, log_request_fd_event,
                               NULL, NULL, &exec->stderr_uctx) < 0) {
                RPEDEBUG("Failed adding event listening to stderr");
                close(exec->stderr_fd);
index f7637db6239df70cb204d70187b6d3fce2aed32d..6e889f26d1449bdb79eab8cb380659f090f395a6 100644 (file)
@@ -278,7 +278,7 @@ int main_loop_init(void)
        }
        DEBUG4("Created self-signal pipe.  Read end FD %i, write end FD %i", self_pipe[0], self_pipe[1]);
 
-       if (fr_event_fd_insert(NULL, event_list, self_pipe[0],
+       if (fr_event_fd_insert(NULL, NULL, event_list, self_pipe[0],
                               main_loop_signal_recv,
                               NULL,
                               NULL,
index c76f6d2cf25ee7c74fbf046a1ded223628831ddd..623819c1d24c42330fb9d8852e50caf4c31bfbba 100644 (file)
@@ -181,15 +181,15 @@ static void _conn_notify(fr_trunk_connection_t *tconn, fr_connection_t *conn,
                break;
 
        case FR_TRUNK_CONN_EVENT_READ:
-               TEST_CHECK(fr_event_fd_insert(conn, el, fd, _conn_io_read, NULL, _conn_io_error, tconn) == 0);
+               TEST_CHECK(fr_event_fd_insert(conn, NULL, el, fd, _conn_io_read, NULL, _conn_io_error, tconn) == 0);
                break;
 
        case FR_TRUNK_CONN_EVENT_WRITE:
-               TEST_CHECK(fr_event_fd_insert(conn, el, fd, NULL, _conn_io_write, _conn_io_error, tconn) == 0);
+               TEST_CHECK(fr_event_fd_insert(conn, NULL, el, fd, NULL, _conn_io_write, _conn_io_error, tconn) == 0);
                break;
 
        case FR_TRUNK_CONN_EVENT_BOTH:
-               TEST_CHECK(fr_event_fd_insert(conn, el, fd, _conn_io_read, _conn_io_write, _conn_io_error, tconn) == 0);
+               TEST_CHECK(fr_event_fd_insert(conn, NULL, el, fd, _conn_io_read, _conn_io_write, _conn_io_error, tconn) == 0);
                break;
 
        default:
@@ -302,7 +302,7 @@ static fr_connection_state_t _conn_open(fr_event_list_t *el, void *h, UNUSED voi
        /*
         *      This always needs to be inserted
         */
-       TEST_CHECK(fr_event_fd_insert(our_h, el, our_h[1], _conn_io_loopback, NULL, NULL, our_h) == 0);
+       TEST_CHECK(fr_event_fd_insert(our_h, NULL, el, our_h[1], _conn_io_loopback, NULL, NULL, our_h) == 0);
 
        return FR_CONNECTION_STATE_CONNECTED;
 }
index fc81efb8025dd21a914761d7c32d3657ac388259..6038a24dcdb8b5cbee7291e2e683553118f7710b 100644 (file)
@@ -276,7 +276,7 @@ int unlang_module_fd_add(request_t *request,
        /*
         *      Register for events on the file descriptor
         */
-       if (fr_event_fd_insert(request, unlang_interpret_event_list(request), fd,
+       if (fr_event_fd_insert(request, NULL, unlang_interpret_event_list(request), fd,
                               ev->fd_read ? unlang_event_fd_read_handler : NULL,
                               ev->fd_write ? unlang_event_fd_write_handler : NULL,
                               ev->fd_error ? unlang_event_fd_error_handler: NULL,
index 6f5d9342665db62a5d89bd2638da5fe66439257b..085eba311957ede61b99cd5f829ae90d9596c731 100644 (file)
@@ -1212,6 +1212,7 @@ int _fr_event_filter_insert(NDEBUG_LOCATION_ARGS
 /** Associate I/O callbacks with a file descriptor
  *
  * @param[in] ctx      to bind lifetime of the event to.
+ * @param[out] ef_out  Where to store the output event
  * @param[in] el       to insert fd callback into.
  * @param[in] fd       to install filters for.
  * @param[in] read_fn  function to call when fd is readable.
@@ -1223,7 +1224,7 @@ int _fr_event_filter_insert(NDEBUG_LOCATION_ARGS
  *     - -1 on failure.
  */
 int _fr_event_fd_insert(NDEBUG_LOCATION_ARGS
-                       TALLOC_CTX *ctx, fr_event_list_t *el, int fd,
+                       TALLOC_CTX *ctx, fr_event_fd_t **ef_out, fr_event_list_t *el, int fd,
                        fr_event_fd_cb_t read_fn,
                        fr_event_fd_cb_t write_fn,
                        fr_event_error_cb_t error,
@@ -1237,7 +1238,7 @@ int _fr_event_fd_insert(NDEBUG_LOCATION_ARGS
        }
 
        return _fr_event_filter_insert(NDEBUG_LOCATION_VALS
-                                      ctx, NULL, el, fd, FR_EVENT_FILTER_IO, &funcs, error, uctx);
+                                      ctx, ef_out, el, fd, FR_EVENT_FILTER_IO, &funcs, error, uctx);
 }
 
 /** Remove a file descriptor from the event loop
index 94a5d24e19dfe663c6b7e48b6e437508a6fa6975..d3c470a5e7ce5cca84f06a66c28e916759187ee3 100644 (file)
@@ -224,7 +224,7 @@ int         _fr_event_filter_update(NDEBUG_LOCATION_ARGS
 #define                fr_event_filter_update(...) _fr_event_filter_update(NDEBUG_LOCATION_EXP __VA_ARGS__)
 
 int            _fr_event_fd_insert(NDEBUG_LOCATION_ARGS
-                                   TALLOC_CTX *ctx, fr_event_list_t *el, int fd,
+                                   TALLOC_CTX *ctx, fr_event_fd_t **ef_out, fr_event_list_t *el, int fd,
                                    fr_event_fd_cb_t read_fn,
                                    fr_event_fd_cb_t write_fn,
                                    fr_event_error_cb_t error,
index 32dfa25fa4a61af5d217be6fb89c5af1f8947ab0..7d2c2332cd9eba6547f148d45b219bf286512dba 100644 (file)
@@ -1283,7 +1283,7 @@ int fr_log_global_init(fr_event_list_t *el, bool daemonize)
        /*
         *      Now do stderr...
         */
-       if (unlikely(fr_event_fd_insert(NULL, el, stdout_pipe[1], fr_log_fd_event, NULL, NULL, &stdout_ctx) < 0)) {
+       if (unlikely(fr_event_fd_insert(NULL, NULL, el, stdout_pipe[1], fr_log_fd_event, NULL, NULL, &stdout_ctx) < 0)) {
                fr_strerror_const_push("Failed adding stdout handler to event loop");
        error_2:
                dup2(STDOUT_FILENO, stdout_fd); /* Copy back the stdout FD */
@@ -1321,7 +1321,7 @@ int fr_log_global_init(fr_event_list_t *el, bool daemonize)
        stdout_ctx.type = L_ERR;
        stdout_ctx.lvl = L_DBG_LVL_OFF; /* Log at all debug levels */
 
-       if (unlikely(fr_event_fd_insert(NULL, el, stderr_pipe[1], fr_log_fd_event, NULL, NULL, &stderr_ctx) < 0)) {
+       if (unlikely(fr_event_fd_insert(NULL, NULL, el, stderr_pipe[1], fr_log_fd_event, NULL, NULL, &stderr_ctx) < 0)) {
                fr_strerror_const_push("Failed adding stdout handler to event loop");
        error_6:
                dup2(STDERR_FILENO, stderr_fd); /* Copy back the stderr FD */
index 7ab8736076ef885b7fd79284ccf7ab03aff95fc5..2c31f0cda126ffa7b0a19de62eb0b712c6f6743f 100644 (file)
@@ -291,7 +291,7 @@ retry:
 
                /*
                 */
-               if (fr_event_fd_insert(uq, uq->el, uq->fd, NULL,
+               if (fr_event_fd_insert(uq, NULL, uq->el, uq->fd, NULL,
                                       udp_queue_writable, NULL, uq) < 0) {
                        return -1;
                }
index 6d66048d40bdba39dca39c8428114885711be0e2..38f2d8280a2713a5b8ba7e043afd2dfac8f18be9 100644 (file)
@@ -1223,7 +1223,7 @@ static void _proto_ldap_socket_open_connected(fr_connection_t *conn, UNUSED fr_c
        /*
         *      Set the callback which will handle the results of this query
         */
-       if (fr_event_fd_insert(conn, conn->el, ldap_conn->fd,
+       if (fr_event_fd_insert(conn, NULL, conn->el, ldap_conn->fd,
                               _proto_ldap_socket_open_read,
                               NULL,
                               _proto_ldap_socket_open_error,
index 583461ae01930a8350757acd91f79d12b217b145..393b9b071b96aba948877f7a85f6039813dbe208 100644 (file)
@@ -477,7 +477,7 @@ static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx)
         *      We assume that the outbound socket is always writable.
         *      If not, too bad.  Packets will get lost.
         */
-       if (fr_event_fd_insert(t, mctx->el, fd,
+       if (fr_event_fd_insert(t, NULL, mctx->el, fd,
                               mod_icmp_read,
                               NULL,
                               mod_icmp_error,
index 4bc77456d8134dac18190492adc90e4e58f52269..1c373916d2d1fc60836177b635694370b12e7f44 100644 (file)
@@ -319,7 +319,7 @@ static void logtee_fd_idle(rlm_logtee_thread_t *t)
        int fd = *((int *)t->conn->h);
 
        DEBUG3("Marking socket (%i) as idle", fd);
-       if (fr_event_fd_insert(t->conn, t->el, fd,
+       if (fr_event_fd_insert(t->conn, NULL, t->el, fd,
                               _logtee_conn_read,
                               NULL,
                               _logtee_conn_error,
@@ -339,7 +339,7 @@ static void logtee_fd_active(rlm_logtee_thread_t *t)
        int fd = *((int *)t->conn->h);
 
        DEBUG3("Marking socket (%i) as active - Draining requests", fd);
-       if (fr_event_fd_insert(t->conn, t->el, fd,
+       if (fr_event_fd_insert(t->conn, NULL, t->el, fd,
                               _logtee_conn_read,
                               _logtee_conn_writable,
                               _logtee_conn_error,
index 033ea277386edb938cfbc178db440b9bcbb1d307..8fe720681456fe47a9bbca30641313e2e59061a1 100644 (file)
@@ -484,7 +484,7 @@ static void conn_status_check_timeout(fr_event_list_t *el, fr_time_t now, void *
                return;
 
        case FR_RETRY_CONTINUE:
-               if (fr_event_fd_insert(h, el, h->fd, conn_writable_status_check, NULL,
+               if (fr_event_fd_insert(h, NULL, el, h->fd, conn_writable_status_check, NULL,
                                       conn_error_status_check, conn) < 0) {
                        PERROR("%s - Failed inserting FD event", h->module_name);
                        fr_connection_signal_reconnect(conn, FR_CONNECTION_FAILED);
@@ -503,7 +503,7 @@ static void conn_status_check_again(fr_event_list_t *el, UNUSED fr_time_t now, v
        fr_connection_t         *conn = talloc_get_type_abort(uctx, fr_connection_t);
        udp_handle_t            *h = talloc_get_type_abort(conn->h, udp_handle_t);
 
-       if (fr_event_fd_insert(h, el, h->fd, conn_writable_status_check, NULL, conn_error_status_check, conn) < 0) {
+       if (fr_event_fd_insert(h, NULL, el, h->fd, conn_writable_status_check, NULL, conn_error_status_check, conn) < 0) {
                PERROR("%s - Failed inserting FD event", h->module_name);
                fr_connection_signal_reconnect(conn, FR_CONNECTION_FAILED);
        }
@@ -660,7 +660,7 @@ static void conn_writable_status_check(fr_event_list_t *el, UNUSED int fd, UNUSE
         *      Switch to waiting on read and insert the event
         *      for the response timeout.
         */
-       if (fr_event_fd_insert(h, conn->el, h->fd, conn_readable_status_check, NULL, conn_error_status_check, conn) < 0) {
+       if (fr_event_fd_insert(h, NULL, conn->el, h->fd, conn_readable_status_check, NULL, conn_error_status_check, conn) < 0) {
                PERROR("%s - Failed inserting FD event", h->module_name);
                goto fail;
        }
@@ -845,7 +845,7 @@ static fr_connection_state_t conn_init(void **h_out, fr_connection_t *conn, void
                 *      one response to bring the connection online,
                 *      otherwise we need inst->num_answers_to_alive
                 */
-               if (fr_event_fd_insert(h, conn->el, h->fd, NULL,
+               if (fr_event_fd_insert(h, NULL, conn->el, h->fd, NULL,
                                       conn_writable_status_check, conn_error_status_check, conn) < 0) goto fail;
        /*
         *      If we're not doing status-checks, signal the connection
@@ -1028,7 +1028,7 @@ static void thread_conn_notify(fr_trunk_connection_t *tconn, fr_connection_t *co
 
        }
 
-       if (fr_event_fd_insert(h, el, h->fd,
+       if (fr_event_fd_insert(h, NULL, el, h->fd,
                               read_fn,
                               write_fn,
                               conn_error,
@@ -1070,7 +1070,7 @@ static void thread_conn_notify_replicate(fr_trunk_connection_t *tconn, fr_connec
                break;
        }
 
-       if (fr_event_fd_insert(h, el, h->fd,
+       if (fr_event_fd_insert(h, NULL, el, h->fd,
                               read_fn,
                               write_fn,
                               conn_error,
index 1699159238ecfd5f85d4531a67d227aa1b240384..a3b2e80bb4b1a6d92238adc714d04fa8b89bc3e0 100644 (file)
@@ -177,7 +177,7 @@ int sigtran_client_thread_register(fr_event_list_t *el)
         *      and resume requests which are
         *      waiting.
         */
-       if (fr_event_fd_insert(NULL, el, req_pipe[0], _sigtran_pipe_read, NULL, _sigtran_pipe_error, NULL) < 0) {
+       if (fr_event_fd_insert(NULL, NULL, el, req_pipe[0], _sigtran_pipe_read, NULL, _sigtran_pipe_error, NULL) < 0) {
                ERROR("worker - Failed listening on osmocom pipe");
                goto error;
        }
index 353bbfa2935079f7cb3c1f02c219f57eea8b3714..2bb33c83017b72c2a2f7823a566bc93a277013e3 100644 (file)
@@ -489,7 +489,7 @@ static void thread_conn_notify(fr_trunk_connection_t *tconn, fr_connection_t *co
 
        }
 
-       if (fr_event_fd_insert(h, el, h->fd,
+       if (fr_event_fd_insert(h, NULL, el, h->fd,
                               read_fn,
                               write_fn,
                               conn_error,
index 415ff3b29becf4f18fd59d05016a3c1257114fa2..6467943ea8a676f2023f6d4d82a7ec39647294bd 100644 (file)
@@ -257,7 +257,7 @@ static int _unbound_io_event_activate(struct ub_event *ub_ev, struct timeval *tv
 
                DEBUG4("unbound event %p - Registered for read+write events on FD %i", ev, ev->fd);
 
-               if (fr_event_fd_insert(ev, ev->ev_b->el, ev->fd,
+               if (fr_event_fd_insert(ev, NULL, ev->ev_b->el, ev->fd,
                                       _unbound_io_service_readable,
                                       _unbound_io_service_writable,
                                       _unbound_io_service_errored,
@@ -272,7 +272,7 @@ static int _unbound_io_event_activate(struct ub_event *ub_ev, struct timeval *tv
 
                DEBUG4("unbound event %p - Registered for read+error events on FD %i", ev, ev->fd);
 
-               if (fr_event_fd_insert(ev, ev->ev_b->el, ev->fd,
+               if (fr_event_fd_insert(ev, NULL, ev->ev_b->el, ev->fd,
                                       _unbound_io_service_readable,
                                       NULL,
                                       _unbound_io_service_errored,
@@ -287,7 +287,7 @@ static int _unbound_io_event_activate(struct ub_event *ub_ev, struct timeval *tv
 
                DEBUG4("unbound event %p - Registered for write+error events on FD %i", ev, ev->fd);
 
-               if (fr_event_fd_insert(ev, ev->ev_b->el, ev->fd,
+               if (fr_event_fd_insert(ev, NULL, ev->ev_b->el, ev->fd,
                                       NULL,
                                       _unbound_io_service_writable,
                                       _unbound_io_service_errored,