summaryrefslogtreecommitdiffstats
path: root/src/logging.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-01-11 10:52:28 +0100
committerHarald Welte <laforge@gnumonks.org>2018-01-12 14:06:02 +0000
commitc90f40a27737edaba3515ccf29faa3edb81bb0ee (patch)
treea0de718b9abaf9e592c8b1921e0a8cae8715499a /src/logging.c
parent68bf16ab6f5d9738d8d6377ed8bc6285fc09c88e (diff)
Allow multiple 'log gsmtap' sinks
Previously we've checked for existing log target with a given hostname from vty code but it was ignored inside the check so only the very first 'log gsmtap' entry was enabled while the rest were silently ignored. Change-Id: I8fd8bda9e07d403a54735da30addb742e56538a2
Diffstat (limited to 'src/logging.c')
-rw-r--r--src/logging.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/logging.c b/src/logging.c
index 1e0b21b5..e4f3e871 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -745,11 +745,18 @@ struct log_target *log_target_find(int type, const char *fname)
llist_for_each_entry(tgt, &osmo_log_target_list, entry) {
if (tgt->type != type)
continue;
- if (tgt->type == LOG_TGT_TYPE_FILE) {
+ switch (tgt->type) {
+ case LOG_TGT_TYPE_FILE:
if (!strcmp(fname, tgt->tgt_file.fname))
return tgt;
- } else
+ break;
+ case LOG_TGT_TYPE_GSMTAP:
+ if (!strcmp(fname, tgt->tgt_gsmtap.hostname))
+ return tgt;
+ break;
+ default:
return tgt;
+ }
}
return NULL;
}