osmith has uploaded this change for review.
sccp_sap_up_ran: ignore RAN until MSC is connected
Related: SYS#5560
Change-Id: Idf9501412484fa92e8836952609fba7c5443d6c9
---
M include/osmocom/bsc_nat/msc_fsm.h
M src/osmo-bsc-nat/bsc_nat_fsm.c
M src/osmo-bsc-nat/msc_fsm.c
3 files changed, 14 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc-nat refs/changes/75/27475/1
diff --git a/include/osmocom/bsc_nat/msc_fsm.h b/include/osmocom/bsc_nat/msc_fsm.h
index 3133a7c..da674fe 100644
--- a/include/osmocom/bsc_nat/msc_fsm.h
+++ b/include/osmocom/bsc_nat/msc_fsm.h
@@ -21,3 +21,4 @@
void msc_fsm_alloc(struct msc *msc);
void msc_fsm_connect(struct msc *msc);
void msc_fsm_rx_reset_ack(struct msc *msc);
+bool msc_fsm_is_connected(struct msc *msc);
diff --git a/src/osmo-bsc-nat/bsc_nat_fsm.c b/src/osmo-bsc-nat/bsc_nat_fsm.c
index f198eca..cea32db 100644
--- a/src/osmo-bsc-nat/bsc_nat_fsm.c
+++ b/src/osmo-bsc-nat/bsc_nat_fsm.c
@@ -23,6 +23,7 @@
#include <osmocom/bsc_nat/bsc_nat_fsm.h>
#include <osmocom/bsc_nat/bssap.h>
#include <osmocom/bsc_nat/logging.h>
+#include <osmocom/bsc_nat/msc_fsm.h>
#include <osmocom/core/fsm.h>
#include <osmocom/core/select.h>
#include <osmocom/gsm/gsm0808.h>
@@ -208,10 +209,17 @@
struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph;
struct osmo_sccp_addr *addr; /* BSC's address */
struct osmo_sccp_addr peer_addr_out;
+ struct msc *msc;
int rc = -1;
LOGP(DMAIN, LOGL_DEBUG, "Rx %s from RAN\n", osmo_scu_prim_name(oph));
+ msc = bsc_nat_msc_get(g_bsc_nat);
+ if (!msc_fsm_is_connected(msc)) {
+ LOGP(DMAIN, LOGL_DEBUG, "Ignoring message from RAN, MSC is not connected yet\n");
+ goto error;
+ }
+
switch (OSMO_PRIM_HDR(oph)) {
case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION):
/* indication of new inbound connection request */
diff --git a/src/osmo-bsc-nat/msc_fsm.c b/src/osmo-bsc-nat/msc_fsm.c
index 2b1ae44..790b0c4 100644
--- a/src/osmo-bsc-nat/msc_fsm.c
+++ b/src/osmo-bsc-nat/msc_fsm.c
@@ -157,3 +157,8 @@
{
osmo_fsm_inst_dispatch(msc->fi, MSC_FSM_EV_RX_RESET_ACK, NULL);
}
+
+bool msc_fsm_is_connected(struct msc *msc)
+{
+ return msc->fi->state == MSC_FSM_ST_CONNECTED;
+}
To view, visit change 27475. To unsubscribe, or for help writing mail filters, visit settings.