Pau Espin Pedrol has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12252 )

Change subject: bsc_main: filter_fn: Compare imsi values instead of subscr 
pointers
......................................................................

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
---
M src/osmo-bsc/osmo_bsc_main.c
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 67fccd3..08bb40d 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 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;

--
To view, visit https://gerrit.osmocom.org/12252
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia73fd2f38e42396db8f6d2cc6b2c163aa8f67f3f
Gerrit-Change-Number: 12252
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pes...@sysmocom.de>

Reply via email to