Change in osmo-sgsn[master]: gbproxy: Send BVC-BLOCK for PTP BVC to SGSN when BSS resets BVCI=0

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
Wed Dec 2 23:11:31 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/21476 )


Change subject: gbproxy: Send BVC-BLOCK for PTP BVC to SGSN when BSS resets BVCI=0
......................................................................

gbproxy: Send BVC-BLOCK for PTP BVC to SGSN when BSS resets BVCI=0

We cannot pass the RESET of BVCI=0 on to the SGSN, as this would affect
all other NSE/BSS, too.  Instead, we block the corresponding PTP BVC.

The BSS is expected to trigger a RESET of the PTP BVC shortly after
completing the BVCI=0 RESET, which will then also unblock those PTP BVC
again.

Change-Id: I48f1c148bc5c7c9a49b789dac78f76c2aa7baff8
---
M src/gbproxy/gb_proxy.c
M src/gbproxy/gb_proxy_peer.c
2 files changed, 24 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/76/21476/1

diff --git a/src/gbproxy/gb_proxy.c b/src/gbproxy/gb_proxy.c
index d8b828c..2c63614 100644
--- a/src/gbproxy/gb_proxy.c
+++ b/src/gbproxy/gb_proxy.c
@@ -1015,13 +1015,18 @@
 {
 	struct gbproxy_peer *from_peer = NULL;
 	uint16_t bvci;
+	uint8_t cause;
 
-	if (!TLVP_PRESENT(tp, BSSGP_IE_BVCI))
+	if (!TLVP_PRESENT(tp, BSSGP_IE_BVCI) || !TLVP_PRESENT(tp, BSSGP_IE_CAUSE))
 		return 0;
 
 	bvci = ntohs(tlvp_val16_unal(tp, BSSGP_IE_BVCI));
-	LOGP(DGPRS, LOGL_INFO, "NSE(%05u) Rx BVC RESET (BVCI=%05u)\n", nsei, bvci);
+	cause = *TLVP_VAL(tp, BSSGP_IE_CAUSE);
+	LOGP(DGPRS, LOGL_INFO, "NSE(%05u) Rx BVC RESET (BVCI=%05u, cause=%s)\n", nsei, bvci,
+	     bssgp_cause_str(cause));
+
 	if (bvci == 0) {
+		struct gbproxy_peer *peer;
 		/* If we receive a BVC reset on the signalling endpoint, we
 		 * don't want the SGSN to reset, as the signalling endpoint
 		 * is common for all point-to-point BVCs (and thus all BTS) */
@@ -1034,6 +1039,19 @@
 			return 0;
 		}
 
+		/* BLOCK all the unblocked PTP BVC of this BSS-side NSE towards the SGSN */
+		llist_for_each_entry(peer, &nse->bts_peers, list) {
+			struct bssgp_bvc_ctx bctx = {
+				.nsei = cfg->nsip_sgsn_nsei,
+				.bvci = peer->bvci,
+			};
+
+			if (peer->blocked)
+				continue;
+
+			bssgp_tx_bvc_block(&bctx, cause);
+		}
+
 		gbproxy_cleanup_peers(cfg, nsei, 0);
 
 		/* FIXME: only do this if SGSN is alive! */
diff --git a/src/gbproxy/gb_proxy_peer.c b/src/gbproxy/gb_proxy_peer.c
index 62c4d94..c95a572 100644
--- a/src/gbproxy/gb_proxy_peer.c
+++ b/src/gbproxy/gb_proxy_peer.c
@@ -260,6 +260,10 @@
 	peer->nse = nse;
 }
 
+/*! remove peers (BVCs) withon NSE specified by NSEI.
+ *  \param[in] cfg proxy in which we operate
+ *  \param[in] nsei NS entity in which we should clean up
+ *  \param[in] bvci if 0: remove all BVCs; if != 0: BVCI of the single BVC to clean up */
 int gbproxy_cleanup_peers(struct gbproxy_config *cfg, uint16_t nsei, uint16_t bvci)
 {
 	int counter = 0;

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I48f1c148bc5c7c9a49b789dac78f76c2aa7baff8
Gerrit-Change-Number: 21476
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201202/67cd89f2/attachment.htm>


More information about the gerrit-log mailing list