From 7caec9e4a40142803f22ed195704cdd46b097db1 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 12 Apr 2017 15:18:45 +0200 Subject: kernel-netlink: Directly handle Netlink messages if thread pool is empty During initialization of the plugins the thread pool is not yet initialized so there is no watcher thread that could handle the queued Netlink message and the main thread will wait indefinitely for a response. Fixes #2199. --- src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c') diff --git a/src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c b/src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c index da54031a1..cf85cb0a6 100644 --- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c +++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c @@ -333,7 +333,8 @@ static status_t send_once(private_netlink_socket_t *this, struct nlmsghdr *in, while (!entry->complete) { if (this->parallel && - lib->watcher->get_state(lib->watcher) != WATCHER_STOPPED) + lib->watcher->get_state(lib->watcher) != WATCHER_STOPPED && + lib->processor->get_total_threads(lib->processor)) { if (this->timeout) { -- cgit v1.2.3