diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-12-11 15:01:01 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-12-11 16:13:21 +0100 |
commit | 8a8052e1177f5973930be2e362e0e71f4b25282d (patch) | |
tree | 21be3a2d15b1e6a933a5a7dec87cc8534a838b66 /src/osmo-bsc/osmo_bsc_main.c | |
parent | a3acb30077ad580ab76ee3273b7383e9295ca68a (diff) |
bsc_main: filter_fn: Compare imsi values instead of subscr pointers
Since we actually want to match by IMSI as specified by filter in VTY.
It will allow to match based on other information later.
Change-Id: Ia73fd2f38e42396db8f6d2cc6b2c163aa8f67f3f
Diffstat (limited to 'src/osmo-bsc/osmo_bsc_main.c')
-rw-r--r-- | src/osmo-bsc/osmo_bsc_main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 67fccd337..08bb40d78 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -35,6 +35,7 @@ #include <osmocom/bsc/lchan_fsm.h> #include <osmocom/bsc/mgw_endpoint_fsm.h> #include <osmocom/bsc/bsc_subscr_conn_fsm.h> +#include <osmocom/bsc/bsc_subscriber.h> #include <osmocom/bsc/assignment_fsm.h> #include <osmocom/bsc/handover_fsm.h> @@ -767,10 +768,12 @@ static const struct log_info_cat osmo_bsc_categories[] = { static int filter_fn(const struct log_context *ctx, struct log_target *tar) { - const struct bsc_subscr *bsub = ctx->ctx[LOG_CTX_BSC_SUBSCR]; + const struct bsc_subscr *bsub_ctx = ctx->ctx[LOG_CTX_BSC_SUBSCR]; + const struct bsc_subscr *bsub_filter = tar->filter_data[LOG_FLT_BSC_SUBSCR]; if ((tar->filter_map & (1 << LOG_FLT_BSC_SUBSCR)) != 0 - && bsub && bsub == tar->filter_data[LOG_FLT_BSC_SUBSCR]) + && bsub_ctx && bsub_filter + && strncmp(bsub_ctx->imsi, bsub_filter->imsi, sizeof(bsub_ctx->imsi)) == 0) return 1; return 0; |