diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-07-13 14:50:46 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-07-13 14:53:16 +0200 |
commit | 7017fa7c9dbcaf0d50d805dfeb5a5c5bed711fe1 (patch) | |
tree | 8ce2a2555866eecce7849c9d47bd22ea94be1d71 /openbsc/src/osmo-bsc_nat/bsc_nat.c | |
parent | f071e16f231280aaef4c1c7525c65b0903aa61a8 (diff) |
[bsc-nat] ctrlif: use llist_entry() macro and fix overly-long lines
Diffstat (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat.c')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index a09695c2c..9ed8e58fe 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -1205,8 +1205,11 @@ static int handle_ctrlif_msg(struct bsc_connection *bsc, struct msgb *msg) 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); + struct bsc_lac_entry *bsc_lac; + bsc_lac = llist_entry(bsc->cfg->lac_list.next, + struct bsc_lac_entry, entry); + var = talloc_asprintf(cmd, "bsc.%i.%s", bsc_lac->lac, + cmd->variable); if (!var) { cmd->type = CTRL_TYPE_ERROR; cmd->reply = "OOM"; @@ -1230,8 +1233,10 @@ static int handle_ctrlif_msg(struct bsc_connection *bsc, struct msgb *msg) 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"); + 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; |