Change in osmo-hlr[master]: store gsup peer upon accepting LU

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 11 11:54:49 UTC 2018


Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/11232 )

Change subject: store gsup peer upon accepting LU
......................................................................

store gsup peer upon accepting LU

Store the GSUP client's IPA_IDTAG_SERNR in vlr_number or sgsn_number (depending
on is_ps), just before sending the Insert Subscriber Data message after a
successful LU Req. Log about it.

Original patch: Ib2611421f3638eadc361787af801fffe9a34bd8a by laforge
Related: OS#2796

Change-Id: If438664faa5d68404f465f8b2002c6d03bbf3ceb
---
M src/hlr.c
1 file changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/hlr.c b/src/hlr.c
index f631d52..26be8d5 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -242,12 +242,15 @@
 static int rx_upd_loc_req(struct osmo_gsup_conn *conn,
 			  const struct osmo_gsup_message *gsup)
 {
+	struct hlr_subscriber *subscr;
 	struct lu_operation *luop = lu_op_alloc_conn(conn);
 	if (!luop) {
 		LOGP(DMAIN, LOGL_ERROR, "LU REQ from conn without addr?\n");
 		return -EINVAL;
 	}
 
+	subscr = &luop->subscr;
+
 	lu_op_statechg(luop, LU_S_LU_RECEIVED);
 
 	switch (gsup->cn_domain) {
@@ -298,6 +301,15 @@
 		lu_op_tx_cancel_old(luop);
 	} else
 #endif
+
+	/* Store the VLR / SGSN number with the subscriber, so we know where it was last seen. */
+	LOGP(DAUC, LOGL_DEBUG, "IMSI='%s': storing %s = %s\n",
+	     subscr->imsi, luop->is_ps ? "SGSN number" : "VLR number",
+	     osmo_quote_str((const char*)luop->peer, -1));
+	if (db_subscr_lu(g_hlr->dbc, subscr->id, (const char *)luop->peer, luop->is_ps))
+		LOGP(DAUC, LOGL_ERROR, "IMSI='%s': Cannot update %s in the database\n",
+		     subscr->imsi, luop->is_ps ? "SGSN number" : "VLR number");
+
 	{
 		/* TODO: Subscriber allowed to roam in PLMN? */
 		/* TODO: Update RoutingInfo */

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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If438664faa5d68404f465f8b2002c6d03bbf3ceb
Gerrit-Change-Number: 11232
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181011/e912ebb1/attachment.htm>


More information about the gerrit-log mailing list