diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2019-12-09 14:56:09 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2020-01-08 23:37:37 +0100 |
commit | 448cb12ff66762fb8fb71334a351801f4ac02901 (patch) | |
tree | 1645b35ffb8715479770c8e3bc5bb30ab011f85c /src/libmsc | |
parent | b63034147f810d5116ec95c7a09b4eb4f33053f2 (diff) |
sms-over-gsup fixups
Change-Id: I9b03a7db839731aee6db3b0b7a525d7502a2c373
Diffstat (limited to 'src/libmsc')
-rw-r--r-- | src/libmsc/gsm_04_11_gsup.c | 27 |
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) |