RR: Send RR STATUS in case of unsupported/unknown message

This fixes BSC_Tests.TC_err_84_unknown_msg

Related: OS#2903
Change-Id: I7ecb48971c6a162c7f4c749d128c31d0dbc4916f
This commit is contained in:
Harald Welte 2018-03-17 21:40:32 +01:00
parent 4a1580b7ff
commit f94cbf607b
3 changed files with 33 additions and 0 deletions

View File

@ -28,6 +28,9 @@ int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
char *mi_string, uint8_t *mi_type);
struct msgb *gsm48_create_loc_upd_rej(uint8_t cause);
struct msgb *gsm48_create_rr_status(uint8_t cause);
int gsm48_tx_rr_status(struct gsm_subscriber_connection *conn, uint8_t cause);
#define GSM48_ALLOC_SIZE 2048
#define GSM48_ALLOC_HEADROOM 256

View File

@ -646,6 +646,7 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn,
* L3 Info of 08.58 MEASUREMENT REPORT different by calling
* directly into gsm48_parse_meas_rep */
LOGP(DMEAS, LOGL_ERROR, "DIRECT GSM48 MEASUREMENT REPORT ?!? ");
gsm48_tx_rr_status(conn, GSM48_RR_CAUSE_MSG_TYPE_N_COMPAT);
break;
case GSM48_MT_RR_HANDO_COMPL:
handle_rr_ho_compl(msg);
@ -692,6 +693,8 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn,
LOGP(DRR, LOGL_NOTICE,
"%s Dropping %s 04.08 RR message\n",
gsm_lchan_name(conn->lchan), gsm48_rr_msg_name(msg_type));
gsm48_tx_rr_status(conn, GSM48_RR_CAUSE_MSG_TYPE_N);
break;
}
break;
default:

View File

@ -640,6 +640,33 @@ int gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
return gsm0808_submit_dtap(conn, msg, 0, 0);
}
/* 9.1.29 RR Status */
struct msgb *gsm48_create_rr_status(uint8_t cause)
{
struct msgb *msg;
struct gsm48_hdr *gh;
msg = gsm48_msgb_alloc_name("GSM 04.08 RR STATUS");
if (!msg)
return NULL;
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
gh->proto_discr = GSM48_PDISC_RR;
gh->msg_type = GSM48_MT_RR_STATUS;
gh->data[0] = cause;
return msg;
}
/* 9.1.29 RR Status */
int gsm48_tx_rr_status(struct gsm_subscriber_connection *conn, uint8_t cause)
{
struct msgb *msg = gsm48_create_rr_status(cause);
if (!msg)
return -1;
return gsm0808_submit_dtap(conn, msg, 0, 0);
}
struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value)
{
struct msgb *msg;