diff --git a/src/tcp_connection.c b/src/tcp_connection.c index 26b9a9f..629ba80 100644 --- a/src/tcp_connection.c +++ b/src/tcp_connection.c @@ -141,27 +141,12 @@ static void destroy_ancillary_data(ancillary_data_t *data) } FSTRACE_DECL(ASYNC_TCP_RECEIVE_ANCILLARY, "UID=%64u SIZE=%z"); -FSTRACE_DECL(ASYNC_TCP_RECEIVE_ANCILLARY_FD, "UID=%64u FD=%d"); FSTRACE_DECL(ASYNC_TCP_RECEIVE_ANCILLARY_DUMP, "UID=%64u DATA=%A"); static void receive_ancillary_data(tcp_conn_t *conn, struct cmsghdr *cp) { size_t anclen = cp->cmsg_len; FSTRACE(ASYNC_TCP_RECEIVE_ANCILLARY, conn->uid, anclen); - int level; - int type; - size_t size = ancillary_data_info(cp, &level, &type); - if (level == SOL_SOCKET && type == SCM_RIGHTS) { - int *fds = (int *) CMSG_DATA(cp); - int remaining_fds = size / sizeof(int); - while (remaining_fds--) { - int fd = *fds++; - ancillary_data_t *data = make_fd_ancillary(fd); - list_append(conn->input.ancillary_list, data); - FSTRACE(ASYNC_TCP_RECEIVE_ANCILLARY_FD, conn->uid, fd); - } - return; - } struct cmsghdr *anc = fsalloc(anclen); memcpy(anc, cp, anclen); ancillary_data_t *data = make_raw_ancillary(anc); diff --git a/test/asynctest-tcp.c b/test/asynctest-tcp.c index 58dff78..548562a 100644 --- a/test/asynctest-tcp.c +++ b/test/asynctest-tcp.c @@ -232,7 +232,7 @@ static void tcp_probe_down_world(TCP_CONTEXT *context) int level = 999, type = 999, fd = 999; count = tcp_peek_ancillary_data(context->conn, &level, &type); if (count < 0) { - tlog("No ancillary data received"); + tlog("No ancillary data received (errno %d)", errno); async_quit_loop(context->async); return; } @@ -246,8 +246,8 @@ static void tcp_probe_down_world(TCP_CONTEXT *context) async_quit_loop(context->async); return; } - count = tcp_recv_ancillary_data(context->conn, &fd, sizeof fd); - if (count != sizeof fd) { + fd = tcp_recv_fd(context->conn); + if (fd < 0) { tlog("Bad ancillary data size received"); async_quit_loop(context->async); return;