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

daniel gerrit-no-reply at lists.osmocom.org
Mon Jul 19 14:11:06 UTC 2021


daniel has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/64/24964/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210719/e8655538/attachment.htm>


More information about the gerrit-log mailing list