[SMS] Properly reject processing of compressed SMS

As we don't support compressed SMS, we have to properly reject it.

In the existing code, we segfaulted at some later point since the error
handling was incomplete.

This was triggered by some obscure STK SIM card that insisted on sending a
compressed SMS after registering to the OpenBSC network.
This commit is contained in:
Harald Welte 2010-06-09 15:29:13 +02:00 committed by Holger Hans Peter Freyther
parent 5bfe499366
commit e98c635391
1 changed files with 5 additions and 1 deletions

View File

@ -369,9 +369,11 @@ enum sms_alphabet gsm338_get_sms_alphabet(u_int8_t dcs)
enum sms_alphabet alpha = DCS_NONE;
if ((cgbits & 0xc) == 0) {
if (cgbits & 2)
if (cgbits & 2) {
LOGP(DSMS, LOGL_NOTICE,
"Compressed SMS not supported yet\n");
return 0xffffffff;
}
switch ((dcs >> 2)&0x03) {
case 0:
@ -551,6 +553,8 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m
gsms->data_coding_scheme = *smsp++;
sms_alphabet = gsm338_get_sms_alphabet(gsms->data_coding_scheme);
if (sms_alphabet == 0xffffffff)
return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER;
switch (sms_vpf) {
case GSM340_TP_VPF_RELATIVE: