aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat/bsc_nat.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-07-13 14:47:34 +0200
committerHarald Welte <laforge@gnumonks.org>2011-07-13 14:53:16 +0200
commitf071e16f231280aaef4c1c7525c65b0903aa61a8 (patch)
tree7a9dfeb713cd31fcb13b5ba3e1d0b5da1fb58f5e /openbsc/src/osmo-bsc_nat/bsc_nat.c
parent6552047d44bf22c6ce6668875d7921729ec623f3 (diff)
[bsc-nat] ctrlif: save ourselves one level of indentation
Diffstat (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat.c')
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c62
1 files changed, 30 insertions, 32 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index f39856ec1..a09695c2c 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1203,40 +1203,38 @@ static int handle_ctrlif_msg(struct bsc_connection *bsc, struct msgb *msg)
goto err;
}
- if (bsc->cfg) {
- if (!llist_empty(&bsc->cfg->lac_list)) {
- if (cmd->variable) {
- var = talloc_asprintf(cmd, "bsc.%i.%s", ((struct bsc_lac_entry *)bsc->cfg->lac_list.next)->lac,
- cmd->variable);
- if (!var) {
- cmd->type = CTRL_TYPE_ERROR;
- cmd->reply = "OOM";
- goto err;
- }
- talloc_free(cmd->variable);
- cmd->variable = var;
+ if (bsc->cfg && !llist_empty(&bsc->cfg->lac_list)) {
+ if (cmd->variable) {
+ var = talloc_asprintf(cmd, "bsc.%i.%s", ((struct bsc_lac_entry *)bsc->cfg->lac_list.next)->lac,
+ cmd->variable);
+ if (!var) {
+ cmd->type = CTRL_TYPE_ERROR;
+ cmd->reply = "OOM";
+ goto err;
}
+ talloc_free(cmd->variable);
+ cmd->variable = var;
+ }
- /* Find the pending command */
- pending = bsc_get_pending(bsc, cmd->id);
- if (pending) {
- id = talloc_strdup(cmd, pending->cmd->id);
- if (!id) {
- cmd->type = CTRL_TYPE_ERROR;
- cmd->reply = "OOM";
- goto err;
- }
- cmd->id = id;
- ctrl_cmd_send(&pending->ccon->write_queue, cmd);
- bsc_del_pending(pending);
- } else {
- /* We need to handle TRAPS here */
- if ((cmd->type != CTRL_TYPE_ERROR) && (cmd->type != CTRL_TYPE_TRAP)) {
- LOGP(DNAT, LOGL_NOTICE, "Got control message from BSC without pending entry\n");
- cmd->type = CTRL_TYPE_ERROR;
- cmd->reply = "No request outstanding";
- goto err;
- }
+ /* Find the pending command */
+ pending = bsc_get_pending(bsc, cmd->id);
+ if (pending) {
+ id = talloc_strdup(cmd, pending->cmd->id);
+ if (!id) {
+ cmd->type = CTRL_TYPE_ERROR;
+ cmd->reply = "OOM";
+ goto err;
+ }
+ cmd->id = id;
+ ctrl_cmd_send(&pending->ccon->write_queue, cmd);
+ bsc_del_pending(pending);
+ } else {
+ /* We need to handle TRAPS here */
+ if ((cmd->type != CTRL_TYPE_ERROR) && (cmd->type != CTRL_TYPE_TRAP)) {
+ LOGP(DNAT, LOGL_NOTICE, "Got control message from BSC without pending entry\n");
+ cmd->type = CTRL_TYPE_ERROR;
+ cmd->reply = "No request outstanding";
+ goto err;
}
}
}