iedemam has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/27137 )
Change subject: stats: sanitize tcp stat name identifiers ......................................................................
stats: sanitize tcp stat name identifiers
The identifiers being used in tcp_stats are not friendly as filenames. This change sanitizes the identifiers before they are used.
BEFORE: ipa-oml,r=127.0.0.1:45749<->l=127.0.0.1:3002 AFTER: ipa-oml_r_127_0_0_1_45749_-_l_127_0_0_1_3002
Change-Id: Ib04c2f5bfcbd6c19dd87debf1fc053abf0b9bef2 --- M src/stats_tcp.c 1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/27137/1
diff --git a/src/stats_tcp.c b/src/stats_tcp.c index dec5b5d..c2694f1 100644 --- a/src/stats_tcp.c +++ b/src/stats_tcp.c @@ -123,6 +123,7 @@ osmo_sock_get_name2(stats_tcp_entry->fd->fd)); else snprintf(stat_name, sizeof(stat_name), "%s", osmo_sock_get_name2(stats_tcp_entry->fd->fd)); + osmo_identifier_sanitize_buf(stat_name, ":", '_'); osmo_stat_item_group_set_name(stats_tcp_entry->stats_tcp, stat_name);
osmo_stat_item_set(osmo_stat_item_group_get_item(stats_tcp_entry->stats_tcp, STATS_TCP_UNACKED),