summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
diff options
context:
space:
mode:
authorKeith <keith@rhizomatica.org>2019-01-17 00:26:27 +0000
committerKeith Whyte <keith@rhizomatica.org>2019-02-28 15:15:58 +0000
commitf706b39eb6132c18e28808807cde1ead83437e77 (patch)
tree4b4b5e870bcff3453b0fcaa273f98ee2ece4c08c /openbsc/src/libmsc
parented8815e723b41e9800f14c67bccd34e51a06beb6 (diff)
Don't deliver alert notifications to an ESME that
is not yet bound. We create a new ESME in smsc->esme_list on establishment of a TCP connection, yet we do not know the system id or anything else, until the ESME identifies and authenticates. So do not send alert notifications until we know the bind status (and system_id) Change-Id: I0e5d55d3fb6ac46d253902df2fe304e1b0fc8bbf
Diffstat (limited to 'openbsc/src/libmsc')
-rw-r--r--openbsc/src/libmsc/smpp_openbsc.c5
-rw-r--r--openbsc/src/libmsc/smpp_smsc.c5
-rw-r--r--openbsc/src/libmsc/smpp_smsc.h5
3 files changed, 10 insertions, 5 deletions
diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c
index f463e1cde..67b2a6674 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -279,6 +279,11 @@ static void alert_all_esme(struct smsc *smsc, struct gsm_subscriber *subscr,
/* we currently send an alert notification to each ESME that is
* connected, and do not require a (non-existant) delivery
* pending flag to be set before. */
+ if (!esme->bind_flags) {
+ LOGP(DSMPP, LOGL_INFO,
+ "ESME is not (yet) bound, skipping alert\n");
+ continue;
+ }
if (!esme->acl->alert_notifications) {
LOGP(DSMPP, LOGL_DEBUG,
"[%s] is not set to receive Alert Notifications\n", esme->system_id);
diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c
index 35097b40d..1cee3fe81 100644
--- a/openbsc/src/libmsc/smpp_smsc.c
+++ b/openbsc/src/libmsc/smpp_smsc.c
@@ -49,11 +49,6 @@
memset(str, 0, sizeof(*str)); \
rc = smpp34_unpack(type, str, data, len)
-enum emse_bind {
- ESME_BIND_RX = 0x01,
- ESME_BIND_TX = 0x02,
-};
-
const struct value_string smpp_status_strs[] = {
{ ESME_ROK, "No Error" },
{ ESME_RINVMSGLEN, "Message Length is invalid" },
diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h
index 239820153..ad1af7642 100644
--- a/openbsc/src/libmsc/smpp_smsc.h
+++ b/openbsc/src/libmsc/smpp_smsc.h
@@ -19,6 +19,11 @@
#define MODE_7BIT 7
#define MODE_8BIT 8
+enum esme_bind {
+ ESME_BIND_RX = 0x01,
+ ESME_BIND_TX = 0x02,
+};
+
enum esme_read_state {
READ_ST_IN_LEN = 0,
READ_ST_IN_MSG = 1,