SMS-over-GSUP: move net->sms_over_gsup check to gsm411_gsup_rx()

Change-Id: I89988b7148b164af304ecae1f53b74f322fdc7bd
diff --git a/src/libmsc/gsm_04_11_gsup.c b/src/libmsc/gsm_04_11_gsup.c
index dfc90cc..1751655 100644
--- a/src/libmsc/gsm_04_11_gsup.c
+++ b/src/libmsc/gsm_04_11_gsup.c
@@ -149,14 +149,6 @@
 		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 @@
 
 	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 @@
 	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",