aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2020-04-20 10:29:19 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2020-04-26 23:55:48 +0700
commit531d3a4b118230255c46476ecc14ee488760b93e (patch)
tree0d34c0dfb6920a4e8bd4925cd82fa9b9ad41b641
parent46b0f80e69c79d52d08062137519b68c14852cc0 (diff)
SMS-over-GSUP: move net->sms_over_gsup check to gsm411_gsup_rx()
-rw-r--r--src/libmsc/gsm_04_11_gsup.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/libmsc/gsm_04_11_gsup.c b/src/libmsc/gsm_04_11_gsup.c
index dfc90cc12..1751655d1 100644
--- a/src/libmsc/gsm_04_11_gsup.c
+++ b/src/libmsc/gsm_04_11_gsup.c
@@ -149,14 +149,6 @@ static int gsm411_gsup_mo_handler(struct gsm_network *net, struct vlr_subscr *vs
OSMO_ASSERT(0);
}
- /* Make sure that 'SMS over GSUP' is expected */
- if (!net->sms_over_gsup) {
- /* TODO: notify sender about that? */
- LOGP(DLSMS, LOGL_NOTICE, "Unexpected MO SMS over GSUP "
- "(sms-over-gsup is not enabled), ignoring message...\n");
- return -EIO;
- }
-
/* Verify GSUP message */
if (!gsup_msg->sm_rp_mr)
goto msg_error;
@@ -241,14 +233,6 @@ static int gsm411_gsup_mt_handler(struct gsm_network *net, struct vlr_subscr *vs
LOGP(DLSMS, LOGL_DEBUG, "RX MT-forwardSM-Req\n");
- /* Make sure that 'SMS over GSUP' is expected */
- if (!net->sms_over_gsup) {
- LOGP(DLSMS, LOGL_NOTICE, "Unexpected MT SMS over GSUP "
- "(sms-over-gsup is not enabled), ignoring message...\n");
- /* TODO: notify sender about that? */
- return -EIO;
- }
-
/**
* Verify GSUP message
*
@@ -296,6 +280,14 @@ int gsm411_gsup_rx(struct gsup_client_mux *gcm, void *data, const struct osmo_gs
struct vlr_subscr *vsub;
int rc;
+ /* Make sure that 'SMS over GSUP' is expected */
+ if (!net->sms_over_gsup) {
+ /* TODO: notify sender about that? */
+ LOGP(DLSMS, LOGL_NOTICE, "Unexpected MO/MT SMS over GSUP "
+ "(sms-over-gsup is not enabled), ignoring message...\n");
+ return -EIO;
+ }
+
vsub = vlr_subscr_find_by_imsi(net->vlr, gsup_msg->imsi, __func__);
if (!vsub) {
LOGP(DLSMS, LOGL_ERROR, "Rx %s for unknown subscriber, rejecting\n",