diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-09-28 01:22:15 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-10-05 17:55:18 +0200 |
commit | cb364bb429b7d188367e445a2bd2b9d81e416d54 (patch) | |
tree | f10db1a80b1cc4f7dd3e37cc5f55364e6c3a981e /src/hlr.c | |
parent | d646207553e3e8a32935ec1cf247f6044c480121 (diff) |
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
Diffstat (limited to 'src/hlr.c')
-rw-r--r-- | src/hlr.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -242,12 +242,15 @@ void lu_op_rx_gsup(struct lu_operation *luop, 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 @@ static int rx_upd_loc_req(struct osmo_gsup_conn *conn, 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 */ |