<p>Pau Espin Pedrol has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12250">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">VTY: Allow logging filter imsi statements for IMSIs we haven't seen yet<br><br>Limiting the logging filter only to IMSIs that we have as local<br>subscriber doesn't make sense for osmo-bsc since all subscribers are<br>initially unknown.<br><br>Create a bsc subscriber and enable logging there. This struct will then<br>be used and liked to the gsm_subscr_conn when receiving the Location<br>update.<br><br>Related: OS#3641<br>Change-Id: Ia20bdc15565417020205d7b2b06b04a01c03106c<br>---<br>M src/osmo-bsc/osmo_bsc_vty.c<br>1 file changed, 8 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/12250/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c</span><br><span>index a32f580..6e3d1c1 100644</span><br><span>--- a/src/osmo-bsc/osmo_bsc_vty.c</span><br><span>+++ b/src/osmo-bsc/osmo_bsc_vty.c</span><br><span>@@ -886,15 +886,21 @@</span><br><span>        struct log_target *tgt = osmo_log_vty2tgt(vty);</span><br><span>      const char *imsi = argv[0];</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- bsc_subscr = bsc_subscr_find_by_imsi(bsc_gsmnet->bsc_subscribers, imsi);</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!tgt)</span><br><span style="color: hsl(120, 100%, 40%);">+             return CMD_WARNING;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc_subscr = bsc_subscr_find_or_create_by_imsi(bsc_gsmnet->bsc_subscribers, imsi);</span><br><span> </span><br><span>    if (!bsc_subscr) {</span><br><span style="color: hsl(0, 100%, 40%);">-              vty_out(vty, "%%no subscriber with IMSI(%s)%s",</span><br><span style="color: hsl(120, 100%, 40%);">+             vty_out(vty, "%%failed to enable logging for subscriber with IMSI(%s)%s",</span><br><span>                  imsi, VTY_NEWLINE);</span><br><span>          return CMD_WARNING;</span><br><span>  }</span><br><span> </span><br><span>        log_set_filter_bsc_subscr(tgt, bsc_subscr);</span><br><span style="color: hsl(120, 100%, 40%);">+   /* log_set_filter has grabbed its own reference  */</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc_subscr_put(bsc_subscr);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>        return CMD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12250">change 12250</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/12250"/><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: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia20bdc15565417020205d7b2b06b04a01c03106c </div>
<div style="display:none"> Gerrit-Change-Number: 12250 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> </div>