From 3a760355705761f46d57a70cca3a34834225ae97 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Tue, 3 Aug 2021 11:26:44 +0200 Subject: bump libnDPI to 6b7e5fa8d251f11c1bae16ea892a43a92b098480 * fixed linking issue by using CMake to check if explicit link against libm required * make nDPIsrvd collectd exit if parent pid changed, meaning that collectd died somehow * nDPId-test restores SIGPIPE to the default handler (termination), so abnormal connection drop's do now have consequences Signed-off-by: Toni Uhlig --- nDPId-test.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'nDPId-test.c') diff --git a/nDPId-test.c b/nDPId-test.c index d8fb80d02..06512b1ff 100644 --- a/nDPId-test.c +++ b/nDPId-test.c @@ -264,7 +264,7 @@ static void * nDPId_mainloop_thread(void * const arg) if (setup_reader_threads() != 0) { THREAD_ERROR(trr); - return NULL; + goto error; } /* Replace nDPId JSON socket fd with the one in our pipe and hope that no socket specific code-path triggered. */ @@ -272,6 +272,11 @@ static void * nDPId_mainloop_thread(void * const arg) reader_threads[0].json_sock_reconnect = 0; jsonize_daemon(&reader_threads[0], DAEMON_EVENT_INIT); + /* restore SIGPIPE to the default handler (Termination) */ + if (signal(SIGPIPE, SIG_DFL) == SIG_ERR) + { + goto error; + } run_pcap_loop(&reader_threads[0]); process_remaining_flows(); for (size_t i = 0; i < nDPId_options.reader_thread_count; ++i) @@ -284,8 +289,9 @@ static void * nDPId_mainloop_thread(void * const arg) nrv->total_active_flows = reader_threads[i].workflow->total_active_flows; nrv->total_idle_flows = reader_threads[i].workflow->total_idle_flows; } - free_reader_threads(); +error: + free_reader_threads(); close(mock_pipefds[PIPE_nDPId]); return NULL; -- cgit v1.2.3