From c90f40a27737edaba3515ccf29faa3edb81bb0ee Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 11 Jan 2018 10:52:28 +0100 Subject: 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 --- src/logging.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/logging.c') 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; } -- cgit v1.2.3