aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_nat_utils.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-17 07:20:00 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-17 07:31:08 +0200
commit941839b3008a1bbd7f89180532f98a8303032ce3 (patch)
tree497c7f63b55f865c2a215bdcfc6a4794b5f88024 /openbsc/src/nat/bsc_nat_utils.c
parent23a0e46f113cc362109970dbe26aba58b4a09f60 (diff)
nat: Move MSC ip address into the config..
The address can still be specified on the cli and it will overwrite the config in the config file.
Diffstat (limited to 'openbsc/src/nat/bsc_nat_utils.c')
-rw-r--r--openbsc/src/nat/bsc_nat_utils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index 58f933742..21459c5e5 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -51,9 +51,17 @@ struct bsc_nat *bsc_nat_alloc(void)
nat->stats.bsc.reconn = counter_alloc("nat.bsc.conn");
nat->stats.bsc.auth_fail = counter_alloc("nat.bsc.auth_fail");
nat->stats.msc.reconn = counter_alloc("nat.msc.conn");
+ nat->msc_ip = talloc_strdup(nat, "127.0.0.1");
return nat;
}
+void bsc_nat_set_msc_ip(struct bsc_nat *nat, const char *ip)
+{
+ if (nat->msc_ip)
+ talloc_free(nat->msc_ip);
+ nat->msc_ip = talloc_strdup(nat, ip);
+}
+
struct bsc_connection *bsc_connection_alloc(struct bsc_nat *nat)
{
struct bsc_connection *con = talloc_zero(nat, struct bsc_connection);