diff options
author | Max <msuraev@sysmocom.de> | 2018-01-11 10:52:28 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-01-12 14:06:02 +0000 |
commit | c90f40a27737edaba3515ccf29faa3edb81bb0ee (patch) | |
tree | a0de718b9abaf9e592c8b1921e0a8cae8715499a | |
parent | 68bf16ab6f5d9738d8d6377ed8bc6285fc09c88e (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
-rw-r--r-- | src/logging.c | 11 |
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; } |