[PATCH] logging: fix parsing of logging mask (-d DMI case)

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

pablo at gnumonks.org pablo at gnumonks.org
Thu Aug 11 11:24:18 UTC 2011


From: Pablo Neira Ayuso <pablo at gnumonks.org>

Without this patch, `-d DMI' enables logging for DMI and DMIB.

Signed-off-by: Pablo Neira Ayuso <pablo at gnumonks.org>
---
 src/logging.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/logging.c b/src/logging.c
index 11d63ac..e85e8fc 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -157,6 +157,11 @@ void log_parse_category_mask(struct log_target* target, const char *_mask)
 		for (i = 0; i < osmo_log_info->num_cat; ++i) {
 			char* colon = strstr(category_token, ",");
 			int length = strlen(category_token);
+			int cat_length = strlen(osmo_log_info->cat[i].name);
+
+			/* Use longest length not to match subocurrences. */
+			if (cat_length > length)
+				length = cat_length;
 
 			if (!osmo_log_info->cat[i].name)
 				continue;
-- 
1.7.2.5





More information about the OpenBSC mailing list