diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-08-03 11:26:44 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-08-03 12:37:59 +0200 |
commit | 3a760355705761f46d57a70cca3a34834225ae97 (patch) | |
tree | 273a6ac4a44af6bb33df0a36c7cd9b5b969c3bed /nDPId-test.c | |
parent | c32461b032fd2fec74821f3bd5c9bcc2c9689de2 (diff) |
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 <matzeton@googlemail.com>
Diffstat (limited to 'nDPId-test.c')
-rw-r--r-- | nDPId-test.c | 10 |
1 files changed, 8 insertions, 2 deletions
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; |