Change in osmo-sgsn[master]: gb_proxy: Slightly restructure processing of BSS-originated BVC-RESET

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
Thu Dec 3 14:24:36 UTC 2020


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

Change subject: gb_proxy: Slightly restructure processing of BSS-originated BVC-RESET
......................................................................

gb_proxy: Slightly restructure processing of BSS-originated BVC-RESET

* explicit else clause rather than implicit
* don't continue processing if mandatory BVCI missing from message

Change-Id: I038576b91ae1ece149149d8663de7b8495d24e06
---
M src/gbproxy/gb_proxy.c
1 file changed, 24 insertions(+), 21 deletions(-)

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



diff --git a/src/gbproxy/gb_proxy.c b/src/gbproxy/gb_proxy.c
index 4f2aa2d..2fd276d 100644
--- a/src/gbproxy/gb_proxy.c
+++ b/src/gbproxy/gb_proxy.c
@@ -1014,31 +1014,34 @@
 					int *copy_to_sgsn2)
 {
 	struct gbproxy_peer *from_peer = NULL;
+	uint16_t bvci;
 
-	/* 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) */
-	if (TLVP_PRESENT(tp, BSSGP_IE_BVCI)) {
-		uint16_t bvci = ntohs(tlvp_val16_unal(tp, BSSGP_IE_BVCI));
-		LOGP(DGPRS, LOGL_INFO, "NSE(%05u) Rx BVC RESET (BVCI=%05u)\n", nsei, bvci);
-		if (bvci == 0) {
-			struct gbproxy_nse *nse;
-			/* Ensure the NSE peer is there and clear all PtP BVCs */
-			nse = gbproxy_nse_by_nsei_or_new(cfg, nsei);
-			if (!nse) {
-				LOGP(DGPRS, LOGL_ERROR, "Could not create NSE(%05u)\n", nsei);
-				bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, 0, msg);
-				return 0;
-			}
+	if (!TLVP_PRESENT(tp, BSSGP_IE_BVCI))
+		return 0;
 
-			gbproxy_cleanup_peers(cfg, nsei, 0);
-
-			/* FIXME: only do this if SGSN is alive! */
-			LOGPNSE(nse, LOGL_INFO, "Tx fake "
-				"BVC RESET ACK of BVCI=0\n");
-			bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_RESET_ACK, nsei, 0, 0);
+	bvci = ntohs(tlvp_val16_unal(tp, BSSGP_IE_BVCI));
+	LOGP(DGPRS, LOGL_INFO, "NSE(%05u) Rx BVC RESET (BVCI=%05u)\n", nsei, bvci);
+	if (bvci == 0) {
+		/* 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) */
+		struct gbproxy_nse *nse;
+		/* Ensure the NSE peer is there and clear all PtP BVCs */
+		nse = gbproxy_nse_by_nsei_or_new(cfg, nsei);
+		if (!nse) {
+			LOGP(DGPRS, LOGL_ERROR, "Could not create NSE(%05u)\n", nsei);
+			bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, 0, msg);
 			return 0;
 		}
+
+		gbproxy_cleanup_peers(cfg, nsei, 0);
+
+		/* FIXME: only do this if SGSN is alive! */
+		LOGPNSE(nse, LOGL_INFO, "Tx fake "
+			"BVC RESET ACK of BVCI=0\n");
+		bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_RESET_ACK, nsei, 0, 0);
+		return 0;
+	} else {
 		from_peer = gbproxy_peer_by_bvci(cfg, bvci);
 		if (!from_peer) {
 			struct gbproxy_nse *nse = gbproxy_nse_by_nsei(cfg, nsei);

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I038576b91ae1ece149149d8663de7b8495d24e06
Gerrit-Change-Number: 21474
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
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/20201203/a661ab64/attachment.htm>


More information about the gerrit-log mailing list