aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2019-12-09 14:56:09 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2020-02-10 11:45:43 +0100
commit86f1a8b0bb6bbe2deafd01a6ce3f3a75aa269f42 (patch)
tree52c6a2a57fbb090e2b37d2aef6110f7f65628bb5
parent8d438c2ebc3936b7b8c23e020d2de630faf417c2 (diff)
sms-over-gsup fixups
-rw-r--r--src/libmsc/gsm_04_11_gsup.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/libmsc/gsm_04_11_gsup.c b/src/libmsc/gsm_04_11_gsup.c
index b6b798f87..bd4bab9f9 100644
--- a/src/libmsc/gsm_04_11_gsup.c
+++ b/src/libmsc/gsm_04_11_gsup.c
@@ -234,7 +234,7 @@ static int gsm411_gsup_mt_handler(struct gsm_network *net, struct vlr_subscr *vs
const struct osmo_gsup_message *gsup_msg)
{
bool sm_rp_mmts_ind;
- int rc;
+ int rc = -EINVAL;
/* Associate logging messages with this subscriber */
log_set_context(LOG_CTX_VLR_SUBSCR, vsub);
@@ -245,8 +245,8 @@ static int gsm411_gsup_mt_handler(struct gsm_network *net, struct vlr_subscr *vs
if (!net->sms_over_gsup) {
LOGP(DLSMS, LOGL_NOTICE, "Unexpected MT SMS over GSUP, "
"ignoring message...\n");
- /* TODO: notify sender about that? */
- return -EIO;
+ rc = -EIO;
+ goto msg_error;
}
/**
@@ -255,14 +255,23 @@ static int gsm411_gsup_mt_handler(struct gsm_network *net, struct vlr_subscr *vs
* FIXME: SM-RP-MR is not known yet (to be assigned by MSC)
* NOTE: SM-RP-DA is out of our interest
*/
- if (!gsup_msg->sm_rp_mr)
+ if (!gsup_msg->sm_rp_mr) {
+ LOGP(DLSMS, LOGL_NOTICE, "RX malformed MT-forwardSM-Req: missing sm_rp_mr\n");
goto msg_error;
- if (!gsup_msg->sm_rp_ui)
+ }
+ if (!gsup_msg->sm_rp_ui){
+ LOGP(DLSMS, LOGL_NOTICE, "RX malformed MT-forwardSM-Req: missing sm_rp_ui\n");
goto msg_error;
+ }
+#if 0
/* SM-RP-OA shall contain SMSC address */
- if (gsup_msg->sm_rp_oa_type != OSMO_GSUP_SMS_SM_RP_ODA_SMSC_ADDR)
+ if (gsup_msg->sm_rp_oa_type != OSMO_GSUP_SMS_SM_RP_ODA_SMSC_ADDR) {
+ LOGP(DLSMS, LOGL_NOTICE, "RX malformed MT-forwardSM-Req: sm_rp_oa_type != SMSC Address (is %d)\n",
+ gsup_msg->sm_rp_oa_type);
goto msg_error;
+ }
+#endif
/* MMS (More Messages to Send) IE is optional */
if (gsup_msg->sm_rp_mms)
@@ -278,16 +287,14 @@ static int gsm411_gsup_mt_handler(struct gsm_network *net, struct vlr_subscr *vs
if (rc) {
LOGP(DLSMS, LOGL_NOTICE, "Failed to send MT SMS, "
"ignoring MT-forwardSM-Req message...\n");
- /* TODO: notify sender about that? */
- return rc;
+ goto msg_error;
}
return 0;
msg_error:
/* TODO: notify sender about that? */
- LOGP(DLSMS, LOGL_NOTICE, "RX malformed MT-forwardSM-Req\n");
- return -EINVAL;
+ return rc;
}
int gsm411_gsup_rx(struct gsup_client_mux *gcm, void *data, const struct osmo_gsup_message *gsup_msg)