summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-10-31 19:18:41 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-10-31 19:18:41 +0700
commit04ac4751701a28b7bec0c812a98d8a7ca1008a69 (patch)
tree837a4d4cfa318008f68e1004a6a9dee3d14a0e0d /utils.h
parent0578d751b1ea0ac10ad2b033f9b73c922f120fdb (diff)
sock_events.c: also track child file descriptors
In some applications, such as OsmocomBB, a single UNIX socket can be used by multiple processes (i.e. a server and multiple clients). Previously this caused a segmentation fault. Let's modify both sock_ev_accept() and sock_ev_accept4() in order to handle such connections properly, by using both socket path and dissector from the parent.
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils.h b/utils.h
index 8145c9b..6829ffe 100644
--- a/utils.h
+++ b/utils.h
@@ -21,6 +21,9 @@ struct sock_state *udtrace_sstate_by_fd(int fd);
/* add a file descriptor from the list of to-be-traced ones */
void udtrace_add_fd(int fd);
+/* add a file descriptor from the list of to-be-traced ones */
+void udtrace_add_fd_child(int pfd, int cfd);
+
/* delete a file descriptor from the list of to-be-traced ones */
void udtrace_del_fd(int fd);
personal git repositories of Harald Welte. Your mileage may vary