Change in osmo-gbproxy[master]: gbproxy: Route DL STATUS with BVCI on SIG-BVC

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 Oct 28 14:37:43 UTC 2021


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

Change subject: gbproxy: Route DL STATUS with BVCI on SIG-BVC
......................................................................

gbproxy: Route DL STATUS with BVCI on SIG-BVC

Fixes TTCN3 gbproxy test TC_status_sig_dl_bvci

Related: OS#4892
Change-Id: I5928cebea7f39d6648f95dfa1a46437de202f723
---
M src/gb_proxy.c
1 file changed, 37 insertions(+), 0 deletions(-)

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



diff --git a/src/gb_proxy.c b/src/gb_proxy.c
index f92585a..5d9219d 100644
--- a/src/gb_proxy.c
+++ b/src/gb_proxy.c
@@ -1018,6 +1018,30 @@
 	return 0;
 }
 
+/* Extract the BVCI from the PDU-in-error of the STATUS PDU (if available) */
+static int gbproxy_bvci_from_status_pdu(struct tlv_parsed *tp, uint16_t *bvci, char *log_pfx)
+{
+	int rc;
+	int pdu_len = TLVP_LEN(&tp[0], BSSGP_IE_PDU_IN_ERROR);
+	const uint8_t *pdu_data = TLVP_VAL(&tp[0], BSSGP_IE_PDU_IN_ERROR);
+	struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *)pdu_data;
+	struct tlv_parsed tp_inner[2];
+
+	/* TODO: Parse partial messages as well */
+	rc = osmo_tlv_prot_parse(&osmo_pdef_bssgp, tp_inner, ARRAY_SIZE(tp_inner), bgph->pdu_type, bgph->data,
+				 pdu_len - sizeof(*bgph), 0, 0, DGPRS, log_pfx);
+
+	if (rc < 0)
+		return rc;
+
+	if (TLVP_PRESENT(&tp_inner[0], BSSGP_IE_BVCI))
+		*bvci = ntohs(tlvp_val16_unal(&tp_inner[0], BSSGP_IE_BVCI));
+	else
+		return -ENOENT;
+
+	return 0;
+}
+
 /* Receive an incoming signalling message from a BSS-side NS-VC */
 static int gbprox_rx_sig_from_bss(struct gbproxy_nse *nse, struct msgb *msg, uint16_t ns_bvci)
 {
@@ -1498,6 +1522,19 @@
 		LOGPNSE(nse, LOGL_NOTICE, "Rx STATUS cause=0x%02x(%s)\n", cause,
 			bssgp_cause_str(cause));
 
+
+		if (gbproxy_bvci_from_status_pdu(tp, &bvci, log_pfx) == 0 && bvci != 0) {
+			struct gbproxy_cell *cell = gbproxy_cell_by_bvci(cfg, bvci);
+
+			if ((!cell || !cell->bss_bvc || !cell->bss_bvc->nse)) {
+				LOGPNSE(nse, LOGL_ERROR, "Rx STATUS cause=0x%02x(%s), but can't find NSE for cell\n",
+					cause, bssgp_cause_str(cause));
+				break;
+			}
+
+			return gbprox_relay2nse(msg, cell->bss_bvc->nse, 0);
+		}
+
 		if (gbproxy_tlli_from_status_pdu(msg, tp, &tlli, log_pfx) == 0) {
 			nse_peer = gbproxy_nse_by_tlli(cfg, tlli);
 			if (nse_peer)

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

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I5928cebea7f39d6648f95dfa1a46437de202f723
Gerrit-Change-Number: 25985
Gerrit-PatchSet: 2
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
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/20211028/2fe2fbe5/attachment.htm>


More information about the gerrit-log mailing list