<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-gbproxy/+/22671">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gb_proxy_peer: Require ra_id and cid in gbproxy_cell_alloc<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, 7 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/71/22671/1</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 871ba68..f838354 100644</span><br><span>--- a/include/osmocom/sgsn/gb_proxy.h</span><br><span>+++ b/include/osmocom/sgsn/gb_proxy.h</span><br><span>@@ -222,7 +222,7 @@</span><br><span>    LOGPBVC_CAT(BVC, DGPRS, LEVEL, FMT, ## ARGS)</span><br><span> </span><br><span> #define LOGPCELL_CAT(CELL, SUBSYS, LEVEL, FMT, ARGS...) \</span><br><span style="color: hsl(0, 100%, 40%);">-   LOGP(SUBSYS, LEVEL, "CELL(%05u) " FMT, (CELL)->bvci, ## ARGS)</span><br><span style="color: hsl(120, 100%, 40%);">+    LOGP(SUBSYS, LEVEL, "CELL(%05u/%05u) " FMT, (CELL)->bvci, (CELL)->id.cid, ## ARGS)</span><br><span> #define LOGPCELL(CELL, LEVEL, FMT, ARGS...) \</span><br><span>  LOGPCELL_CAT(CELL, DGPRS, LEVEL, FMT, ## ARGS)</span><br><span> </span><br><span>@@ -263,7 +263,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 04ebaf6..2dee5b2 100644</span><br><span>--- a/src/gb_proxy.c</span><br><span>+++ b/src/gb_proxy.c</span><br><span>@@ -669,9 +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, ra_id, sizeof(*ra_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 ac1c981..2b19c8b 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: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>