Change in osmo-hlr[master]: fix is_ps logic in rx_upd_loc_req(), store CS as is_ps = false

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Oct 4 12:36:03 UTC 2018


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/11230


Change subject: fix is_ps logic in rx_upd_loc_req(), store CS as is_ps = false
......................................................................

fix is_ps logic in rx_upd_loc_req(), store CS as is_ps = false

A missing 'else' in rx_upd_loc_req() causes *all* clients to be indicated as
is_ps=true regardless of the GSUP CN Domain IE that was received.

Replace that odd if cascade with a switch() that fixes the flawed logic. Hence
osmo-hlr now correctly indicates each client's is_ps, iff the client sends CN
Domain IEs in GSUP LU Request messages.

Related: OS#2796, OS#3601
Change-Id: I2c5fa9f5cae25cfd66afbf088303edff7d045a00
---
M src/hlr.c
1 file changed, 6 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/30/11230/1

diff --git a/src/hlr.c b/src/hlr.c
index df48a99..f631d52 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -250,18 +250,19 @@
 
 	lu_op_statechg(luop, LU_S_LU_RECEIVED);
 
-	if (gsup->cn_domain == OSMO_GSUP_CN_DOMAIN_CS)
+	switch (gsup->cn_domain) {
+	case OSMO_GSUP_CN_DOMAIN_CS:
 		conn->supports_cs = true;
-	if (gsup->cn_domain == OSMO_GSUP_CN_DOMAIN_PS) {
-		conn->supports_ps = true;
-		luop->is_ps = true;
-	} else {
+		break;
+	default:
 		/* The client didn't send a CN_DOMAIN IE; assume packet-switched in
 		 * accordance with the GSUP spec in osmo-hlr's user manual (section
 		 * 11.6.15 "CN Domain" says "if no CN Domain IE is present within
 		 * a request, the PS Domain is assumed." */
+	case OSMO_GSUP_CN_DOMAIN_PS:
 		conn->supports_ps = true;
 		luop->is_ps = true;
+		break;
 	}
 	llist_add(&luop->list, &g_lu_ops);
 

-- 
To view, visit https://gerrit.osmocom.org/11230
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c5fa9f5cae25cfd66afbf088303edff7d045a00
Gerrit-Change-Number: 11230
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181004/da81f9e1/attachment.htm>


More information about the gerrit-log mailing list