Log error if we try and use netlink in a child process.

Child processes to handle TCP connections don't
have an open netlink socket. If they call
iface_enumerate() that's a bug.
This commit is contained in:
Simon Kelley committed 2025-12-01 09:52:51 +00:00
1 parent 959dead673
commit cef74423e2
2 files changed
+8 -2

No files matched your search

+7
View File
@@ -165,6 +165,13 @@ int iface_enumerate(int family, void *parm, callback_t callback)
struct rtgenmsg g;
} req;
/* The netlink socket is not available in child processes. */
if (daemon->pipe_to_parent != -1)
{
my_syslog(LOG_ERR, _("BUG: called iface_enumerate() in child process"));
return 0;
}
memset(&req, 0, sizeof(req));
memset(&addr, 0, sizeof(addr));