Change in openbsc[master]: Don't deliver alert notifications to an ESME that is not yet bound.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Keith Whyte gerrit-no-reply at lists.osmocom.org
Thu Feb 28 18:17:38 UTC 2019


Keith Whyte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12602 )

Change subject: Don't deliver alert notifications to an ESME that is not yet bound.
......................................................................

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
---
M openbsc/src/libmsc/smpp_openbsc.c
M openbsc/src/libmsc/smpp_smsc.c
M openbsc/src/libmsc/smpp_smsc.h
3 files changed, 10 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c
index f463e1c..67b2a66 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -279,6 +279,11 @@
 		/* 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 35097b4..1cee3fe 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 2398201..ad1af76 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,

-- 
To view, visit https://gerrit.osmocom.org/12602
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0e5d55d3fb6ac46d253902df2fe304e1b0fc8bbf
Gerrit-Change-Number: 12602
Gerrit-PatchSet: 4
Gerrit-Owner: Keith Whyte <keith at rhizomatica.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Keith Whyte <keith at rhizomatica.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190228/37ad781e/attachment.htm>


More information about the gerrit-log mailing list