fix vlr ops.subscr_assoc re-association
In rare cases, a conn is already associated with a subscriber. So far, we abort()ed on that. Rather log an error and keep the service running. Related: OS#3743 Change-Id: Ic0d54644bc735700220b1ef3a4384c217d57d20f
This commit is contained in:
parent
e5eb6d4ffd
commit
bc6b8fbd08
|
@ -235,7 +235,7 @@ struct vlr_ops {
|
|||
void (*subscr_update)(struct vlr_subscr *vsub);
|
||||
/* notify MSC/SGSN that the given subscriber has been associated
|
||||
* with this msc_conn_ref */
|
||||
void (*subscr_assoc)(void *msc_conn_ref, struct vlr_subscr *vsub);
|
||||
int (*subscr_assoc)(void *msc_conn_ref, struct vlr_subscr *vsub);
|
||||
|
||||
/* Forward a parsed GSUP message towards MSC message router */
|
||||
int (*forward_gsup_msg)(struct vlr_subscr *vsub, struct osmo_gsup_message *gsup_msg);
|
||||
|
|
|
@ -1804,12 +1804,22 @@ static void update_classmark(const struct gsm_classmark *src, struct gsm_classma
|
|||
}
|
||||
|
||||
/* VLR informs us that the subscriber has been associated with a conn */
|
||||
static void msc_vlr_subscr_assoc(void *msc_conn_ref,
|
||||
static int msc_vlr_subscr_assoc(void *msc_conn_ref,
|
||||
struct vlr_subscr *vsub)
|
||||
{
|
||||
struct ran_conn *conn = msc_conn_ref;
|
||||
OSMO_ASSERT(vsub);
|
||||
OSMO_ASSERT(!conn->vsub);
|
||||
if (conn->vsub) {
|
||||
if (conn->vsub == vsub)
|
||||
LOGPCONN(conn, LOGL_NOTICE, "msc_vlr_subscr_assoc(): conn already associated with %s\n",
|
||||
vlr_subscr_name(vsub));
|
||||
else {
|
||||
LOGPCONN(conn, LOGL_ERROR, "msc_vlr_subscr_assoc(): conn already associated with a subscriber,"
|
||||
" cannot associate with %s\n", vlr_subscr_name(vsub));
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
OSMO_ASSERT(!conn->vsub || conn->vsub );
|
||||
conn->vsub = vlr_subscr_get(vsub);
|
||||
OSMO_ASSERT(conn->vsub);
|
||||
conn->vsub->cs.attached_via_ran = conn->via_ran;
|
||||
|
@ -1820,6 +1830,7 @@ static void msc_vlr_subscr_assoc(void *msc_conn_ref,
|
|||
update_classmark(&conn->temporary_classmark, &conn->vsub->classmark);
|
||||
|
||||
ran_conn_update_id(conn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msc_vlr_route_gsup_msg(struct vlr_subscr *vsub,
|
||||
|
|
|
@ -72,7 +72,7 @@ struct proc_arq_priv {
|
|||
bool implicitly_accepted_parq_by_ciphering_cmd;
|
||||
};
|
||||
|
||||
static void assoc_par_with_subscr(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub)
|
||||
static int assoc_par_with_subscr(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub)
|
||||
{
|
||||
struct proc_arq_priv *par = fi->priv;
|
||||
struct vlr_instance *vlr = par->vlr;
|
||||
|
@ -81,7 +81,7 @@ static void assoc_par_with_subscr(struct osmo_fsm_inst *fi, struct vlr_subscr *v
|
|||
par->vsub = vsub;
|
||||
/* Tell MSC to associate this subscriber with the given
|
||||
* connection */
|
||||
vlr->ops.subscr_assoc(par->msc_conn_ref, par->vsub);
|
||||
return vlr->ops.subscr_assoc(par->msc_conn_ref, par->vsub);
|
||||
}
|
||||
|
||||
static const char *vlr_proc_arq_result_name(const struct osmo_fsm_inst *fi)
|
||||
|
@ -371,8 +371,10 @@ static void proc_arq_vlr_fn_init(struct osmo_fsm_inst *fi,
|
|||
GSM48_REJECT_NETWORK_FAILURE);
|
||||
}
|
||||
vsub->proc_arq_fsm = fi;
|
||||
assoc_par_with_subscr(fi, vsub);
|
||||
proc_arq_vlr_fn_post_imsi(fi);
|
||||
if (assoc_par_with_subscr(fi, vsub) != 0)
|
||||
proc_arq_fsm_done(fi, GSM48_REJECT_NETWORK_FAILURE);
|
||||
else
|
||||
proc_arq_vlr_fn_post_imsi(fi);
|
||||
vlr_subscr_put(vsub);
|
||||
return;
|
||||
}
|
||||
|
@ -414,8 +416,10 @@ static void proc_arq_vlr_fn_w_obt_imsi(struct osmo_fsm_inst *fi,
|
|||
proc_arq_fsm_done(fi, GSM48_REJECT_IMSI_UNKNOWN_IN_VLR);
|
||||
return;
|
||||
}
|
||||
assoc_par_with_subscr(fi, vsub);
|
||||
proc_arq_vlr_fn_post_imsi(fi);
|
||||
if (assoc_par_with_subscr(fi, vsub))
|
||||
proc_arq_fsm_done(fi, GSM48_REJECT_NETWORK_FAILURE);
|
||||
else
|
||||
proc_arq_vlr_fn_post_imsi(fi);
|
||||
vlr_subscr_put(vsub);
|
||||
}
|
||||
|
||||
|
|
|
@ -954,7 +954,8 @@ static int assoc_lfp_with_sub(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub)
|
|||
lfp->vsub = vsub;
|
||||
/* Tell MSC to associate this subscriber with the given
|
||||
* connection */
|
||||
vlr->ops.subscr_assoc(lfp->msc_conn_ref, lfp->vsub);
|
||||
if (vlr->ops.subscr_assoc(lfp->msc_conn_ref, lfp->vsub))
|
||||
lu_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue