<p>daniel has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-gbproxy/+/26456">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gbproxy_peer: Free all related BVCs if the cell is freed<br><br>Previously the SGSN BVCs would still be present after the related Cell<br>was freed. This caused some inconsistencies if a BVC with the same BVCI<br>was established again. The symptoms of this were cells that were attached<br>to no SGSN or the same one multiple times and crashes.<br><br>This patch ensures that the SGSN-side BVCs are also freed when the cell<br>is freed and that this fact is reflected when handling reset<br>notifications.<br><br>Change-Id: Iedeede8917e2870e0b62a2050ccb331109167017<br>---<br>M src/gb_proxy.c<br>M src/gb_proxy_peer.c<br>2 files changed, 12 insertions(+), 2 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/56/26456/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gb_proxy.c b/src/gb_proxy.c</span><br><span>index d6d760f..69a58d4 100644</span><br><span>--- a/src/gb_proxy.c</span><br><span>+++ b/src/gb_proxy.c</span><br><span>@@ -682,8 +682,10 @@</span><br><span>                               LOGPBVC(bvc->cell->bss_bvc, LOGL_NOTICE, "Destroying due to conflicting "</span><br><span>                                    "BVCI configuration (new NSEI=%05u)!\n", bvc->nse->nsei);</span><br><span>                            gbproxy_bvc_free(bvc->cell->bss_bvc);</span><br><span style="color: hsl(120, 100%, 40%);">+                           bvc->cell = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+                  } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                              LOGPBVC(bvc, LOGL_ERROR, "Found cell without BSS BVC, this should not happen!");</span><br><span>                   }</span><br><span style="color: hsl(0, 100%, 40%);">-                       bvc->cell->bss_bvc = bvc;</span><br><span>              }</span><br><span>    }</span><br><span> </span><br><span>diff --git a/src/gb_proxy_peer.c b/src/gb_proxy_peer.c</span><br><span>index f59cf9e..0070155 100644</span><br><span>--- a/src/gb_proxy_peer.c</span><br><span>+++ b/src/gb_proxy_peer.c</span><br><span>@@ -217,8 +217,16 @@</span><br><span> {</span><br><span>   int i;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      if (cell->bss_bvc == bvc)</span><br><span style="color: hsl(120, 100%, 40%);">+  if (cell->bss_bvc == bvc) {</span><br><span style="color: hsl(120, 100%, 40%);">+                /* Remove the whole cell including all BVCs */</span><br><span style="color: hsl(120, 100%, 40%);">+                for (i = 0; i < ARRAY_SIZE(cell->sgsn_bvc); i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      if (cell->sgsn_bvc[i]) {</span><br><span style="color: hsl(120, 100%, 40%);">+                           gbproxy_bvc_free(cell->sgsn_bvc[i]);</span><br><span style="color: hsl(120, 100%, 40%);">+                               cell->sgsn_bvc[i] = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+                  }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span>            return gbproxy_cell_free(cell);</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span> </span><br><span>        /* we could also be a SGSN-side BVC */</span><br><span>       for (i = 0; i < ARRAY_SIZE(cell->sgsn_bvc); i++) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-gbproxy/+/26456">change 26456</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/+/26456"/><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: Iedeede8917e2870e0b62a2050ccb331109167017 </div>
<div style="display:none"> Gerrit-Change-Number: 26456 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>