summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-02-21 16:37:10 +0100
committerHarald Welte <laforge@gnumonks.org>2019-02-21 16:38:49 +0100
commit52a8375025cb266a43f937198569e8947a930ead (patch)
tree77c6701336c40b2f2be83907845fbabaa80caf4e /src
parent9ef2e15dc190a51de85cb9439676ddc1cd7c1fd2 (diff)
select: Call log_reset_context() before calling file descriptor callbacks
Make sure to clear any log context before processing the next incoming message as part of some file descriptor callback. This effectively prevents "context leaking" from processing of one message into processing of the next message as part of one iteration through the list of file descriptors here. Change-Id: I3644c7bc1a9cec5858eb0faf94efc8c3ba7f5d8d Closes: OS#3813
Diffstat (limited to 'src')
-rw-r--r--src/select.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/select.c b/src/select.c
index b594ca55..4e7be354 100644
--- a/src/select.c
+++ b/src/select.c
@@ -35,6 +35,7 @@
#include <osmocom/core/select.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/timer.h>
+#include <osmocom/core/logging.h>
#include "../config.h"
@@ -214,6 +215,11 @@ restart:
if (flags) {
work = 1;
+ /* make sure to clear any log context before processing the next incoming message
+ * as part of some file descriptor callback. This effectively prevents "context
+ * leaking" from processing of one message into processing of the next message as part
+ * of one iteration through the list of file descriptors here. See OS#3813 */
+ log_reset_context();
ufd->cb(ufd, flags);
}
/* ugly, ugly hack. If more than one filedescriptor was