Change in osmo-sgsn[master]: gbproxy: (Re)allocate SGSN-side PTP BVC even if CELL already exists

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Dec 12 14:36:39 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/21689 )

Change subject: gbproxy: (Re)allocate SGSN-side PTP BVC even if CELL already exists
......................................................................

gbproxy: (Re)allocate SGSN-side PTP BVC even if CELL already exists

After a SGSN-side RESET of the SIG-BVC, all PTP BVC on the SGSN side
are gone.  However, the CELLs and the BSS side BVCs continue to exist
(as there may be other SGSNs).

So if a PTP-BVC RESET from the BSS side arrives in such a situation,
and we can find a matching CELL, we still need to check if we need
to create any SGSN-side PTP BVCs instead of simply being happy with
the CELLs already existing.

Change-Id: I1d1562e421082fa4399c73ac31290e4c95718e49
Closes: OS#4903
---
M src/gbproxy/gb_proxy.c
1 file changed, 17 insertions(+), 19 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gbproxy/gb_proxy.c b/src/gbproxy/gb_proxy.c
index 0dd45d4..5e6f238 100644
--- a/src/gbproxy/gb_proxy.c
+++ b/src/gbproxy/gb_proxy.c
@@ -479,6 +479,7 @@
 {
 	struct gbproxy_bvc *bvc = priv;
 	struct gbproxy_config *cfg = bvc->nse->cfg;
+	struct gbproxy_nse *sgsn_nse;
 	unsigned int i;
 
 	OSMO_ASSERT(bvci != 0);
@@ -502,7 +503,6 @@
 	}
 
 	if (!bvc->cell) {
-		struct gbproxy_nse *sgsn_nse;
 		/* if we end up here, it means this is the first time we received a BVC-RESET
 		 * for this BVC.  We need to create the 'cell' data structure and the SGSN-side
 		 * BVC counterparts */
@@ -513,28 +513,26 @@
 
 		/* link us to the cell and vice-versa */
 		bvc->cell->bss_bvc = bvc;
+	}
 
-		/* allocate the SGSN-side BVCs within the cell, and reset them */
-		hash_for_each(cfg->sgsn_nses, i, sgsn_nse, list) {
-			struct gbproxy_bvc *sgsn_bvc = gbproxy_bvc_by_bvci(sgsn_nse, bvci);
-			if (sgsn_bvc)
-				OSMO_ASSERT(!sgsn_bvc->cell);
+	/* allocate (any missing) SGSN-side BVCs within the cell, and reset them */
+	hash_for_each(cfg->sgsn_nses, i, sgsn_nse, list) {
+		struct gbproxy_bvc *sgsn_bvc = gbproxy_bvc_by_bvci(sgsn_nse, bvci);
+		if (sgsn_bvc)
+			OSMO_ASSERT(sgsn_bvc->cell == bvc->cell || !sgsn_bvc->cell);
 
-			if (!sgsn_bvc) {
-				sgsn_bvc = gbproxy_bvc_alloc(sgsn_nse, bvci);
-				OSMO_ASSERT(sgsn_bvc);
+		if (!sgsn_bvc) {
+			sgsn_bvc = gbproxy_bvc_alloc(sgsn_nse, bvci);
+			OSMO_ASSERT(sgsn_bvc);
 
-				sgsn_bvc->cell = bvc->cell;
-				memcpy(sgsn_bvc->ra, bvc->cell->ra, sizeof(sgsn_bvc->ra));
-				sgsn_bvc->fi = bssgp_bvc_fsm_alloc_ptp_bss(sgsn_bvc, cfg->nsi, sgsn_nse->nsei,
-									   bvci, ra_id, cell_id);
-				OSMO_ASSERT(sgsn_bvc->fi);
-				bssgp_bvc_fsm_set_ops(sgsn_bvc->fi, &sgsn_ptp_bvc_fsm_ops, sgsn_bvc);
+			sgsn_bvc->cell = bvc->cell;
+			memcpy(sgsn_bvc->ra, bvc->cell->ra, sizeof(sgsn_bvc->ra));
+			sgsn_bvc->fi = bssgp_bvc_fsm_alloc_ptp_bss(sgsn_bvc, cfg->nsi, sgsn_nse->nsei,
+								   bvci, ra_id, cell_id);
+			OSMO_ASSERT(sgsn_bvc->fi);
+			bssgp_bvc_fsm_set_ops(sgsn_bvc->fi, &sgsn_ptp_bvc_fsm_ops, sgsn_bvc);
 
-				gbproxy_cell_add_sgsn_bvc(bvc->cell, sgsn_bvc);
-			} else {
-				OSMO_ASSERT(sgsn_bvc->cell == bvc->cell);
-			}
+			gbproxy_cell_add_sgsn_bvc(bvc->cell, sgsn_bvc);
 		}
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21689
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I1d1562e421082fa4399c73ac31290e4c95718e49
Gerrit-Change-Number: 21689
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201212/440d0d13/attachment.htm>


More information about the gerrit-log mailing list