<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/9288">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">try to pick up subsrc IMSI on l3-compl<br><br>This is a tiny step towards being aware of a connection's subscriber identity.<br>Iff the Layer 3 Complete message contains an IMSI, associate a bsc_subscr with<br>the conn, so that subsequent logging and possibly meas_feed contains the IMSI.<br><br>For any L3 Complete using TMSI, this has no effect whatsoever.<br><br>Related: OS#2969<br>Change-Id: I3b696a0c0932e3abcb682ba231db65755d8c27a6<br>---<br>M src/osmo-bsc/osmo_bsc_api.c<br>1 file changed, 16 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c</span><br><span>index f3c36c3..a86b4f9 100644</span><br><span>--- a/src/osmo-bsc/osmo_bsc_api.c</span><br><span>+++ b/src/osmo-bsc/osmo_bsc_api.c</span><br><span>@@ -20,6 +20,7 @@</span><br><span> #include <osmocom/bsc/bsc_subscr_conn_fsm.h></span><br><span> #include <osmocom/bsc/osmo_bsc.h></span><br><span> #include <osmocom/bsc/bsc_msc_data.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/bsc/bsc_subscriber.h></span><br><span> #include <osmocom/bsc/debug.h></span><br><span> </span><br><span> #include <osmocom/bsc/gsm_04_80.h></span><br><span>@@ -258,8 +259,22 @@</span><br><span>            return BSC_API_CONN_POL_REJECT;</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   if (imsi)</span><br><span style="color: hsl(120, 100%, 40%);">+     /* TODO: also extract TMSI. We get an IMSI only when an initial L3 Complete comes in that</span><br><span style="color: hsl(120, 100%, 40%);">+      * contains an IMSI. We filter by IMSI. A TMSI identity is never returned here, see e.g.</span><br><span style="color: hsl(120, 100%, 40%);">+       * _cr_check_loc_upd() and other similar functions called from bsc_msg_filter_initial(). */</span><br><span style="color: hsl(120, 100%, 40%);">+   if (imsi) {</span><br><span>          conn->filter_state.imsi = talloc_steal(conn, imsi);</span><br><span style="color: hsl(120, 100%, 40%);">+                if (conn->bsub) {</span><br><span style="color: hsl(120, 100%, 40%);">+                  /* Already a subscriber on L3 Complete? Should never happen... */</span><br><span style="color: hsl(120, 100%, 40%);">+                     if (conn->bsub->imsi[0]</span><br><span style="color: hsl(120, 100%, 40%);">+                     && strcmp(conn->bsub->imsi, imsi))</span><br><span style="color: hsl(120, 100%, 40%);">+                          LOGP(DMSC, LOGL_ERROR, "Subscriber's IMSI changes from %s to %s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                                  conn->bsub->imsi, imsi);</span><br><span style="color: hsl(120, 100%, 40%);">+                   bsc_subscr_set_imsi(conn->bsub, imsi);</span><br><span style="color: hsl(120, 100%, 40%);">+             } else</span><br><span style="color: hsl(120, 100%, 40%);">+                        conn->bsub = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                       imsi);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span>    conn->filter_state.con_type = con_type;</span><br><span> </span><br><span>       /* check return value, if failed check msg for and send USSD */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9288">change 9288</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/9288"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I3b696a0c0932e3abcb682ba231db65755d8c27a6 </div>
<div style="display:none"> Gerrit-Change-Number: 9288 </div>
<div style="display:none"> Gerrit-PatchSet: 8 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>