aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/include/openbsc/bsc_nat.h1
-rw-r--r--openbsc/src/nat/bsc_nat.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index 99a3aa6b7..80d69d196 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -126,6 +126,7 @@ struct sccp_connections {
/* status */
int con_type;
+ int con_local;
/* GSM audio handling. That is 32 * multiplex + ts */
int crcx;
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index 615654c4d..e743bfaad 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -609,6 +609,7 @@ static void ipaccess_auth_bsc(struct tlv_parsed *tvp, struct bsc_connection *bsc
static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg)
{
int con_found = 0;
+ int con_filter = 0;
struct bsc_connection *con_bsc = NULL;
int con_type;
struct bsc_nat_parsed *parsed;
@@ -659,6 +660,7 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg)
if (con) {
con_found = 1;
con_bsc = con->bsc;
+ con_filter = con->con_local;
}
break;
case SCCP_MSG_TYPE_RLC:
@@ -666,6 +668,7 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg)
if (con) {
con_found = 1;
con_bsc = con->bsc;
+ con_filter = con->con_local;
}
remove_sccp_src_ref(bsc, msg, parsed);
break;
@@ -693,6 +696,10 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg)
goto exit2;
}
+ /* do not forward messages to the MSC */
+ if (con_filter)
+ goto exit2;
+
/* send the non-filtered but maybe modified msg */
queue_for_msc(nat->msc_con, msg);
talloc_free(parsed);