[PATCH] libosmo-sccp[master]: sccp: check for valid point code in osmo_sccp_simple_client()

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/.

dexter gerrit-no-reply at lists.osmocom.org
Fri Aug 11 13:40:51 UTC 2017


Review at  https://gerrit.osmocom.org/3480

sccp: check for valid point code in osmo_sccp_simple_client()

The point-code is not checked in the beginning, only the ASP
checks the point code at a very late stage and fails in case
an invalid point-code is detected.

Remove the check in the ASP creation.

Add a new check after the SS7 initalization that checks the
point-code. If none is set, the default point-code will be
used.

Change-Id: I334d90e769bd9952f67c51b12a945f22bd268fa8
---
M src/sccp_user.c
1 file changed, 10 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/80/3480/1

diff --git a/src/sccp_user.c b/src/sccp_user.c
index 4e28aa0..387061c 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -342,6 +342,16 @@
 		ss7->cfg.primary_pc = default_pc;
 		ss7_created = true;
 	}
+
+	/* In case no valid point-code has been configured via the VTY, we
+	 * will fall back to the default pointcode. */
+	if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) {
+		LOGP(DLSCCP, LOGL_ERROR,
+		     "SS7 instance %u: no primary point-code set, using default point-code\n",
+		     ss7->cfg.id);
+		ss7->cfg.primary_pc = default_pc;
+	}
+
 	LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name,
 	     ss7->cfg.id, osmo_ss7_pointcode_print(ss7, ss7->cfg.primary_pc));
 
@@ -364,12 +374,6 @@
 		if (!as)
 			goto out_ss7;
 		as_created = true;
-
-		if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) {
-			LOGP(DLSCCP, LOGL_ERROR, "SS7 instance %u: no primary point-code set\n",
-			     ss7->cfg.id);
-			goto out_ss7;
-		}
 		as->cfg.routing_key.pc = ss7->cfg.primary_pc;
 	}
 	LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name,

-- 
To view, visit https://gerrit.osmocom.org/3480
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I334d90e769bd9952f67c51b12a945f22bd268fa8
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list