Change in osmo-gbproxy[master]: gbproxy_ctrl: Fix crash in nsvc-state ctrl command

laforge gerrit-no-reply at lists.osmocom.org
Tue Jul 27 07:25:15 UTC 2021


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

Change subject: gbproxy_ctrl: Fix crash in nsvc-state ctrl command
......................................................................

gbproxy_ctrl: Fix crash in nsvc-state ctrl command

ctrl_nsvc_state_cb() expects us to pass a struct nsvc_cb_data so do that
instead of passing only the ctrl_cmd.

Related: OS#5200, SYS#5542
Change-Id: I8bc67cc9bc90dab9cfca30b062d1d78897aa1e51
---
M src/gb_proxy_ctrl.c
1 file changed, 16 insertions(+), 4 deletions(-)

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



diff --git a/src/gb_proxy_ctrl.c b/src/gb_proxy_ctrl.c
index 35ef81b..99dcbe1 100644
--- a/src/gb_proxy_ctrl.c
+++ b/src/gb_proxy_ctrl.c
@@ -64,15 +64,27 @@
 	/* NS-VCs for SGSN */
 	hash_for_each(cfg->sgsn_nses, i, nse_peer, list) {
 		nse = gprs_ns2_nse_by_nsei(nsi, nse_peer->nsei);
-		if (nse)
-			gprs_ns2_nse_foreach_nsvc(nse, &ctrl_nsvc_state_cb, cmd);
+		if (nse) {
+			struct nsvc_cb_data cb_data = {
+				.cmd = cmd,
+				.nsei = nse_peer->nsei,
+				.is_sgsn = true,
+			};
+			gprs_ns2_nse_foreach_nsvc(nse, &ctrl_nsvc_state_cb, &cb_data);
+		}
 	}
 
 	/* NS-VCs for BSS peers */
 	hash_for_each(cfg->bss_nses, i, nse_peer, list) {
 		nse = gprs_ns2_nse_by_nsei(nsi, nse_peer->nsei);
-		if (nse)
-			gprs_ns2_nse_foreach_nsvc(nse, &ctrl_nsvc_state_cb, cmd);
+		if (nse) {
+			struct nsvc_cb_data cb_data = {
+				.cmd = cmd,
+				.nsei = nse_peer->nsei,
+				.is_sgsn = true,
+			};
+			gprs_ns2_nse_foreach_nsvc(nse, &ctrl_nsvc_state_cb, &cb_data);
+		}
 	}
 
 	return CTRL_CMD_REPLY;

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

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I8bc67cc9bc90dab9cfca30b062d1d78897aa1e51
Gerrit-Change-Number: 24964
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann 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/20210727/942f6a8d/attachment.htm>


More information about the gerrit-log mailing list