diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2025-08-16 10:54:14 +0200 |
---|---|---|
committer | Dimitri Staessens <dimitri@ouroboros.rocks> | 2025-08-23 10:13:33 +0200 |
commit | 575adac4acacf7d02395df0322ff5f03b7b82aaf (patch) | |
tree | f5de69d4f3599f2be0a075b9a9e1af52a9754ad5 /src/irmd/ipcp.c | |
parent | d0b9463a9e52332b8b0b856d2f9773bbb5d42433 (diff) | |
download | ouroboros-575adac4acacf7d02395df0322ff5f03b7b82aaf.tar.gz ouroboros-575adac4acacf7d02395df0322ff5f03b7b82aaf.zip |
ipcpd: Fix request handling at shutdown
The IPCP states were not entirely correct causing some operations to
be serviced during shutdown. This caused some use-after-free in the
pff. States in the IPCP are now correctly set. IRMd states updated to
the same strategy. The IRMd registry tracks if the IPCP was ENROLLED
or BOOTSTRAPPED, the IPCP just goes to OPERATIONAL.
IPCP state diagram::
NULL -> init() -> INIT -> start() -> BOOT ->
bootstrap/enroll() -> OPERATIONAL -> shutdown()
-> SHUTDOWN -> stop_components() -> BOOT ->
stop() -> INIT -> fini() -> NULL
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Diffstat (limited to 'src/irmd/ipcp.c')
-rw-r--r-- | src/irmd/ipcp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/irmd/ipcp.c b/src/irmd/ipcp.c index 1e8980fb..fdee6a75 100644 --- a/src/irmd/ipcp.c +++ b/src/irmd/ipcp.c @@ -94,11 +94,14 @@ ipcp_msg_t * send_recv_ipcp_msg(pid_t pid, return NULL; spath = sock_path(pid, IPCP_SOCK_PATH_PREFIX); - if (spath == NULL) + if (spath == NULL) { + log_err("Failed to get IPCP socket path for pid %d.", pid); return NULL; + } sockfd = client_socket_open(spath); if (sockfd < 0) { + log_err("Failed to open client socket at %s.", spath); free(spath); return NULL; } |