aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_nat.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-16 16:36:36 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:20 +0800
commitc58da4b374c6a748bda60c6e3068568b8a3f220c (patch)
treed08f2273de4c9c446a12ccc3f3f00965d08b52c3 /openbsc/src/nat/bsc_nat.c
parent605f62a16a98ad25e98d3032e771e369839092a1 (diff)
[nat] Add the notion of a "local" connection.
A local connection is only between the MUX and the real BSC. We will not forward anything to the MSC. This will be needed for the IMSI filtering as sending a CREF is not liked by every BSC...
Diffstat (limited to 'openbsc/src/nat/bsc_nat.c')
-rw-r--r--openbsc/src/nat/bsc_nat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index 3ee537473..65f6eecdb 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);