From 575adac4acacf7d02395df0322ff5f03b7b82aaf Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 16 Aug 2025 10:54:14 +0200 Subject: 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 --- src/irmd/ipcp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/irmd/ipcp.c') 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; } -- cgit v1.2.3