From 39ae17fb6945c0b4d88fa219fea1563fb9177fdc Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 16 Sep 2016 01:49:08 +0200 Subject: msgb ctx: use new msgb_talloc_ctx_init(), don't access talloc_msgb_ctx Drop extern definitions of talloc_msgb_ctx and use msgb_talloc_ctx_init() instead. In sgsn_test.c, use a local variable msgb_ctx to do the talloc report from the return value of msgb_talloc_ctx_init(). Change-Id: I2f9ace855f0ecbdc9adf5d75bcb1a3d666570de4 --- openbsc/src/gprs/gb_proxy_main.c | 4 +--- openbsc/src/gprs/sgsn_main.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'openbsc/src/gprs') diff --git a/openbsc/src/gprs/gb_proxy_main.c b/openbsc/src/gprs/gb_proxy_main.c index 2ddfca7c5..04875c7c2 100644 --- a/openbsc/src/gprs/gb_proxy_main.c +++ b/openbsc/src/gprs/gb_proxy_main.c @@ -189,8 +189,6 @@ static void handle_options(int argc, char **argv) } } -extern void *tall_msgb_ctx; - extern int bsc_vty_go_parent(struct vty *vty); static struct vty_app_info vty_info = { @@ -231,7 +229,7 @@ int main(int argc, char **argv) int rc; tall_bsc_ctx = talloc_named_const(NULL, 0, "nsip_proxy"); - tall_msgb_ctx = talloc_named_const(tall_bsc_ctx, 0, "msgb"); + msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); signal(SIGABRT, &signal_handler); diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c index 822c35930..b4be6318c 100644 --- a/openbsc/src/gprs/sgsn_main.c +++ b/openbsc/src/gprs/sgsn_main.c @@ -163,7 +163,6 @@ static void signal_handler(int signal) /* NSI that BSSGP uses when transmitting on NS */ extern struct gprs_ns_inst *bssgp_nsi; -extern void *tall_msgb_ctx; extern int bsc_vty_go_parent(struct vty *vty); @@ -328,7 +327,7 @@ int main(int argc, char **argv) srand(time(NULL)); tall_bsc_ctx = talloc_named_const(NULL, 0, "osmo_sgsn"); - tall_msgb_ctx = talloc_named_const(tall_bsc_ctx, 0, "msgb"); + msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); signal(SIGABRT, &signal_handler); -- cgit v1.2.3