diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-10-27 12:41:19 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-10-27 12:41:19 +0200 |
commit | 732d9c19bf5c9e50b647ce87f01ac231b1f13c9c (patch) | |
tree | 84299874e5cf903d17e174d59e9d6b9f2478f0e0 /openbsc/src/nat/bsc_nat.c | |
parent | c4fd45ccf17705792f39c09b51392996ecb2c4f2 (diff) | |
parent | 643931db3d235005d8e1fb818275cc322c002692 (diff) |
Merge branch 'zecke/number-rewrite'0.9.9
Diffstat (limited to 'openbsc/src/nat/bsc_nat.c')
-rw-r--r-- | openbsc/src/nat/bsc_nat.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index a428e823d..3e878b87f 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -901,6 +901,15 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg) /* hand data to a side channel */ if (bsc_check_ussd(con, parsed, msg) == 1) con->con_local = 2; + + /* + * Optionally rewrite setup message. This can + * replace the msg and the parsed structure becomes + * invalid. + */ + msg = bsc_nat_rewrite_setup(bsc->nat, msg, parsed, con->imsi); + talloc_free(parsed); + parsed = NULL; } con_bsc = con->bsc; @@ -956,7 +965,8 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg) /* send the non-filtered but maybe modified msg */ queue_for_msc(con_msc, msg); - talloc_free(parsed); + if (parsed) + talloc_free(parsed); return 0; exit: |