summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-08-20 19:55:17 +0200
committerHarald Welte <laforge@gnumonks.org>2014-08-21 15:34:17 +0200
commitc9df37d84a7a9bace75cc0549a21fdcd9b178182 (patch)
tree13d84714571b88cdbc26929fff1642f9f60dedda
parent1238cc64d79308c3db46baa7f755f17ac3db9e49 (diff)
libctrl: Avoid using external tall_bsc_ctx
Instead of using one flat talloc context (and one that is specific to openbsc), we should attach the objects to whatever parent context they are being used in.
-rw-r--r--src/ctrl/control_if.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c
index 7ce8bf60..a2080714 100644
--- a/src/ctrl/control_if.c
+++ b/src/ctrl/control_if.c
@@ -96,7 +96,7 @@ struct ctrl_cmd *ctrl_cmd_trap(struct ctrl_cmd *cmd)
{
struct ctrl_cmd *trap;
- trap = ctrl_cmd_cpy(tall_bsc_ctx, cmd);
+ trap = ctrl_cmd_cpy(cmd, cmd);
if (!trap)
return NULL;
@@ -281,10 +281,10 @@ static uint64_t get_rate_ctr_value(const struct rate_ctr *ctr, int intv)
}
}
-static char *get_all_rate_ctr_in_group(const struct rate_ctr_group *ctrg, int intv)
+static char *get_all_rate_ctr_in_group(void *ctx, const struct rate_ctr_group *ctrg, int intv)
{
int i;
- char *counters = talloc_strdup(tall_bsc_ctx, "");
+ char *counters = talloc_strdup(ctx, "");
if (!counters)
return NULL;
@@ -314,7 +314,7 @@ static int get_rate_ctr_group(const char *ctr_group, int intv, struct ctrl_cmd *
if (!ctrg)
break;
- counters = get_all_rate_ctr_in_group(ctrg, intv);
+ counters = get_all_rate_ctr_in_group(cmd, ctrg, intv);
if (!counters)
goto oom;
@@ -340,7 +340,7 @@ static int get_rate_ctr_group_idx(const struct rate_ctr_group *ctrg, int intv, s
{
char *counters;
- counters = get_all_rate_ctr_in_group(ctrg, intv);
+ counters = get_all_rate_ctr_in_group(cmd, ctrg, intv);
if (!counters)
goto oom;
@@ -527,7 +527,7 @@ struct ctrl_handle *controlif_setup(struct gsm_network *gsmnet, uint16_t port,
int ret;
struct ctrl_handle *ctrl;
- ctrl = talloc_zero(tall_bsc_ctx, struct ctrl_handle);
+ ctrl = talloc_zero(gsmnet, struct ctrl_handle);
if (!ctrl)
return NULL;