aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gb_proxy_vty.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-08-06 18:55:15 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2014-08-13 10:29:09 +0200
commit89d3d343d1d15fb5f48826c73171c51b61b47efb (patch)
tree48eddc9c29f08eb65198a6b9b9478aeaaffa023b /openbsc/src/gprs/gb_proxy_vty.c
parent58da91d5d0a43f2fcccae842c805e7c49f95e534 (diff)
gbproxy: Track TLLI even when the IMSI is not known
Currently only TLLIs for which it is known that they may be patched are put into the TLLI list. This patch changes this to add TLLIs even when the IMSI is not yet known. A enable_patching flag is added to the gbproxy_tlli_info structure to control patching. Note that this puts every active TLLI into the list where accesses are O(N) currently. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gb_proxy_vty.c')
-rw-r--r--openbsc/src/gprs/gb_proxy_vty.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/openbsc/src/gprs/gb_proxy_vty.c
index 68d5e74d0..ec73ae646 100644
--- a/openbsc/src/gprs/gb_proxy_vty.c
+++ b/openbsc/src/gprs/gb_proxy_vty.c
@@ -368,10 +368,14 @@ DEFUN(show_gbproxy_tllis, show_gbproxy_tllis_cmd, "show gbproxy tllis",
llist_for_each_entry(tlli_info, &state->enabled_tllis, list) {
time_t age = now - tlli_info->timestamp;
- snprintf(mi_buf, sizeof(mi_buf), "(invalid)");
- gsm48_mi_to_string(mi_buf, sizeof(mi_buf),
- tlli_info->mi_data,
- tlli_info->mi_data_len);
+ if (tlli_info->mi_data_len > 0) {
+ snprintf(mi_buf, sizeof(mi_buf), "(invalid)");
+ gsm48_mi_to_string(mi_buf, sizeof(mi_buf),
+ tlli_info->mi_data,
+ tlli_info->mi_data_len);
+ } else {
+ snprintf(mi_buf, sizeof(mi_buf), "(none)");
+ }
vty_out(vty, " TLLI %08x, IMSI %s, AGE %d%s",
tlli_info->tlli, mi_buf, (int)age,
VTY_NEWLINE);