From bc5468562a98a5d994a67260427063a51ae1dfd5 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 29 Oct 2020 01:57:11 +0100 Subject: spoof LU reject when there is no MSC Change-Id: I0cb2dbbeca0bdc6b3cb06ef6daa6272a82780da6 --- src/osmo-bsc/gsm_08_08.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c index 2c51c958a..dedf02735 100644 --- a/src/osmo-bsc/gsm_08_08.c +++ b/src/osmo-bsc/gsm_08_08.c @@ -41,6 +41,7 @@ #include #include +#include #define LOG_COMPL_L3(pdisc, mtype, loglevel, format, args...) \ LOGP(DRSL, loglevel, "%s %s: " format, gsm48_pdisc_name(pdisc), gsm48_pdisc_msgtype_name(pdisc, mtype), ##args) @@ -364,6 +365,25 @@ static void parse_powercap(struct gsm_subscriber_connection *conn, struct msgb * conn_update_ms_power_class(conn, rc8); } +static void spoof_reject(struct gsm_subscriber_connection *conn) +{ + struct msgb *msg; + struct e1inp_sign_link *rsl_link; + + msg = gsm48_create_loc_upd_rej(GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + if (!msg) { + LOGP(DRSL, LOGL_ERROR, "Failed to create msg for LOCATION UPDATING REJECT.\n"); + return; + } + + rsl_link = conn->lchan->ts->trx->rsl_link; + msg->l3h = msg->data; + rsl_rll_push_l3(msg, RSL_MT_DATA_REQ, gsm_lchan2chan_nr(conn->lchan), + rsl_link->sapi, 1); + msg->dst = rsl_link; + abis_rsl_sendmsg(msg); +} + /*! MS->MSC: New MM context with L3 payload. */ int bsc_compl_l3(struct gsm_lchan *lchan, struct msgb *msg, uint16_t chosen_channel) { @@ -481,6 +501,7 @@ int bsc_compl_l3(struct gsm_lchan *lchan, struct msgb *msg, uint16_t chosen_chan "%s%s: No suitable MSC for this Complete Layer 3 request found\n", osmo_mobile_identity_to_str_c(OTC_SELECT, &mi), is_emerg ? " FOR EMERGENCY CALL" : ""); + spoof_reject(conn); goto early_exit; } -- cgit v1.2.3