aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/osmo-bsc/lb.c3
-rw-r--r--src/osmo-bsc/osmo_bsc_sigtran.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/osmo-bsc/lb.c b/src/osmo-bsc/lb.c
index c34d88ea3..6e2d07498 100644
--- a/src/osmo-bsc/lb.c
+++ b/src/osmo-bsc/lb.c
@@ -36,6 +36,9 @@ static struct gsm_subscriber_connection *get_bsc_conn_by_lb_conn_id(uint32_t con
{
struct gsm_subscriber_connection *conn;
+ /* Range (0..SCCP_CONN_ID_MAX) expected, see bsc_sccp_inst_next_conn_id() */
+ OSMO_ASSERT(conn_id <= SCCP_CONN_ID_MAX);
+
llist_for_each_entry(conn, &bsc_gsmnet->subscr_conns, entry) {
if (conn->lcs.lb.state != SUBSCR_SCCP_ST_NONE
&& conn->lcs.lb.conn_id == conn_id)
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 1d4fe827a..973832b23 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -48,10 +48,12 @@ static struct llist_head *msc_list;
/* Helper function to Check if the given connection id is already assigned */
static struct gsm_subscriber_connection *get_bsc_conn_by_conn_id(const struct osmo_sccp_user *scu, uint32_t conn_id)
{
- conn_id &= SCCP_CONN_ID_MAX;
struct gsm_subscriber_connection *conn;
const struct osmo_sccp_instance *sccp = osmo_sccp_get_sccp(scu);
+ /* Range (0..SCCP_CONN_ID_MAX) expected, see bsc_sccp_inst_next_conn_id() */
+ OSMO_ASSERT(conn_id <= SCCP_CONN_ID_MAX);
+
llist_for_each_entry(conn, &bsc_gsmnet->subscr_conns, entry) {
if (conn->sccp.msc && conn->sccp.msc->a.sccp != sccp)
continue;