<p>dexter <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-gbproxy/+/22671">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  daniel: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gb_proxy_peer: Require ra_id and cid in gbproxy_cell_alloc<br><br>pass raid and cell id directly as parameter to gbproxy_cell_alloc so<br>that we do not need to fill tas parameter to gbproxy_cell_alloc so that<br>we do not need to fill the struct members later.<br><br>Change-Id: Ic7deae5ccf839b941d70557d28451d52f32cebbb<br>Related: SYS#5103<br>---<br>M include/osmocom/sgsn/gb_proxy.h<br>M src/gb_proxy.c<br>M src/gb_proxy_peer.c<br>3 files changed, 6 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h</span><br><span>index 96b2bcc..a36f305 100644</span><br><span>--- a/include/osmocom/sgsn/gb_proxy.h</span><br><span>+++ b/include/osmocom/sgsn/gb_proxy.h</span><br><span>@@ -268,7 +268,7 @@</span><br><span> void gbproxy_bvc_free(struct gbproxy_bvc *bvc);</span><br><span> int gbproxy_cleanup_bvcs(struct gbproxy_nse *nse, uint16_t bvci);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-struct gbproxy_cell *gbproxy_cell_alloc(struct gbproxy_config *cfg, uint16_t bvci);</span><br><span style="color: hsl(120, 100%, 40%);">+struct gbproxy_cell *gbproxy_cell_alloc(struct gbproxy_config *cfg, uint16_t bvci, const struct gprs_ra_id *raid, uint16_t cid);</span><br><span> struct gbproxy_cell *gbproxy_cell_by_bvci(struct gbproxy_config *cfg, uint16_t bvci);</span><br><span> struct gbproxy_cell *gbproxy_cell_by_cellid(struct gbproxy_config *cfg, const struct gprs_ra_id *raid, uint16_t cid);</span><br><span> void gbproxy_cell_free(struct gbproxy_cell *cell);</span><br><span>diff --git a/src/gb_proxy.c b/src/gb_proxy.c</span><br><span>index 12e685d..116530f 100644</span><br><span>--- a/src/gb_proxy.c</span><br><span>+++ b/src/gb_proxy.c</span><br><span>@@ -669,10 +669,8 @@</span><br><span>              * for this BVC.  We need to create the 'cell' data structure and the SGSN-side</span><br><span>               * BVC counterparts */</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-              bvc->cell = gbproxy_cell_alloc(cfg, bvci);</span><br><span style="color: hsl(120, 100%, 40%);">+         bvc->cell = gbproxy_cell_alloc(cfg, bvci, ra_id, cell_id);</span><br><span>                OSMO_ASSERT(bvc->cell);</span><br><span style="color: hsl(0, 100%, 40%);">-              memcpy(&bvc->cell->id.raid, &bvc->raid, sizeof(bvc->cell->id.raid));</span><br><span style="color: hsl(0, 100%, 40%);">-             bvc->cell->id.cid = cell_id;</span><br><span> </span><br><span>               /* link us to the cell and vice-versa */</span><br><span>             bvc->cell->bss_bvc = bvc;</span><br><span>diff --git a/src/gb_proxy_peer.c b/src/gb_proxy_peer.c</span><br><span>index 753355e..9ea00a9 100644</span><br><span>--- a/src/gb_proxy_peer.c</span><br><span>+++ b/src/gb_proxy_peer.c</span><br><span>@@ -163,7 +163,8 @@</span><br><span>  ***********************************************************************/</span><br><span> </span><br><span> /* Allocate a new 'cell' object */</span><br><span style="color: hsl(0, 100%, 40%);">-struct gbproxy_cell *gbproxy_cell_alloc(struct gbproxy_config *cfg, uint16_t bvci)</span><br><span style="color: hsl(120, 100%, 40%);">+struct gbproxy_cell *gbproxy_cell_alloc(struct gbproxy_config *cfg, uint16_t bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+                                   const struct gprs_ra_id *raid, uint16_t cid)</span><br><span> {</span><br><span>    struct gbproxy_cell *cell;</span><br><span>   OSMO_ASSERT(cfg);</span><br><span>@@ -174,6 +175,8 @@</span><br><span> </span><br><span>  cell->cfg = cfg;</span><br><span>  cell->bvci = bvci;</span><br><span style="color: hsl(120, 100%, 40%);">+ cell->id.cid = cid;</span><br><span style="color: hsl(120, 100%, 40%);">+        memcpy(&cell->id.raid, raid, sizeof(cell->id.raid));</span><br><span> </span><br><span>   hash_add(cfg->cells, &cell->list, cell->bvci);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-gbproxy/+/22671">change 22671</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/c/osmo-gbproxy/+/22671"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-gbproxy </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ic7deae5ccf839b941d70557d28451d52f32cebbb </div>
<div style="display:none"> Gerrit-Change-Number: 22671 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>