stp: Allow/Disallow to inject messages on the UDP/M2UA interface
diff --git a/src/main_stp.c b/src/main_stp.c
index 57f509f..6e8752e 100644
--- a/src/main_stp.c
+++ b/src/main_stp.c
@@ -206,6 +206,11 @@
 		return -1;
 	}
 
+	if (!bsc->allow_inject) {
+		LOGP(DINP, LOGL_ERROR, "Injecting messages is not allowed.\n");
+		return -1;
+	}
+
 	m2ua = m2ua_from_msg(rc, buf);
 	if (!m2ua) {
 		LOGP(DINP, LOGL_ERROR, "Failed to parse M2UA.\n");