diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-09-15 01:11:08 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-09-15 18:58:36 +0800 |
commit | 74e0a1b91c87804d25eb16eed47f3f83f962de6c (patch) | |
tree | 4138d5fdf52745398cf4f07006623b780b3a8a88 /openbsc/src/nat/bsc_nat.c | |
parent | 909e61fddcdd97ed1bb8c44951f12dc3590f6521 (diff) |
nat: Start inspecting every message coming from the BSC for the IMSI
Return early in case the IMSI was already checked, if not we need
to look at the connection and check if the message could contain a
imsi we want/need to filter.
Diffstat (limited to 'openbsc/src/nat/bsc_nat.c')
-rw-r--r-- | openbsc/src/nat/bsc_nat.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index 31009bb30..c7d97aa45 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -731,9 +731,17 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg) case SCCP_MSG_TYPE_IT: con = patch_sccp_src_ref_to_msc(msg, parsed, bsc); if (con) { - con_bsc = con->bsc; - con_msc = con->msc_con; - con_filter = con->con_local; + filter = bsc_nat_filter_dt(bsc, msg, con, parsed); + if (filter == 0) { + con_bsc = con->bsc; + con_msc = con->msc_con; + con_filter = con->con_local; + } else { + LOGP(DNAT, LOGL_ERROR, "Should drop the connection.\n"); + con_bsc = con->bsc; + con_msc = con->msc_con; + con_filter = con->con_local; + } } break; case SCCP_MSG_TYPE_RLC: |