Change in osmo-pcu[master]: gprs_bssgp_pcu: fix: do not crash on receipt of subsequent INFO.ind

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
Mon Oct 12 15:12:50 UTC 2020


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

Change subject: gprs_bssgp_pcu: fix: do not crash on receipt of subsequent INFO.ind
......................................................................

gprs_bssgp_pcu: fix: do not crash on receipt of subsequent INFO.ind

It's expected to receive subsequent INFO.ind messages at run-time,
e.g. when a dynamic TCH/F_TCH/H_PDCH timeslot is switched from
PDCH to TCH/F or TCH/H, osmo-bts would send us INFO.ind with the
updated PDCH slot-mask indicating that this timeslot is disabled.

In gprs_nsvc_create_and_connect(), do not bind() on the received
NSVC address unconditionally - we may already be bound to it.
Instead, return early and keep everything unchanged.

I don't know how the PCU is supposed to handle NSVC address change,
at least the new NS2 library does not handle this internally, nor
it provides any API for that.  Let's leave it for later.

Change-Id: I159138e41e147cd30212da548b0ccd3f81d61b4e
Related: I4c3bc883d795e5d1ee5ab175ac03684924692a7c
Fixes: Ib389925cf5c9f18951af6242c31ea70476218e9a
Related: SYS#5108
---
M src/gprs_bssgp_pcu.cpp
1 file changed, 15 insertions(+), 10 deletions(-)

Approvals:
  Jenkins Builder: Verified
  lynxis lazus: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index e0cfc37..adf5bf3 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -930,6 +930,21 @@
 	struct gprs_ns2_vc_bind *bind;
 	int rc;
 
+	bts->nse = gprs_ns2_nse_by_nsei(bts->nsi, nsei);
+	if (bts->nse != NULL) {
+		/* FIXME: we end up here on receipt of subsequent INFO.ind.
+		 * What are we supposed to do? Re-establish the connection? */
+		LOGP(DBSSGP, LOGL_INFO, "NSE with NSEI %u is already configured, "
+		     "keeping it unchanged\n", nsei);
+		return 0;
+	}
+
+	bts->nse = gprs_ns2_create_nse(bts->nsi, nsei);
+	if (!bts->nse) {
+		LOGP(DBSSGP, LOGL_ERROR, "Failed to create NSE\n");
+		return 1;
+	}
+
 	rc = gprs_ns2_ip_bind(bts->nsi, local, 0, &bind);
 	if (rc < 0) {
 		LOGP(DBSSGP, LOGL_ERROR, "Failed to create socket\n");
@@ -937,16 +952,6 @@
 		return 1;
 	}
 
-	bts->nse = gprs_ns2_nse_by_nsei(bts->nsi, nsei);
-	if (!bts->nse)
-		bts->nse = gprs_ns2_create_nse(bts->nsi, nsei);
-
-	if (!bts->nse) {
-		LOGP(DBSSGP, LOGL_ERROR, "Failed to create NSE\n");
-		gprs_ns2_free_bind(bind);
-		return 1;
-	}
-
 	if (bts->gb_dialect_sns) {
 		rc = gprs_ns2_ip_connect_sns(bind, sgsn, nsei);
 	} else {

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I159138e41e147cd30212da548b0ccd3f81d61b4e
Gerrit-Change-Number: 20530
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201012/26821f21/attachment.htm>


More information about the gerrit-log mailing list