diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-04-11 17:27:22 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-04-11 17:29:12 +0200 |
commit | 4d7bab009e5c42bdb5ae418a9cc9bd10b831c383 (patch) | |
tree | 3b24f6173a9a25202b15f525dad4a61a13bb358c /openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c | |
parent | 58ee5b05c8b0d14da0f8a360a6de11a41997ea06 (diff) |
bsc_nat: Drop redundant ccon ptr in bsc_cmd_list
Change-Id: Ic2e4ca7d8eb4e8f71dc773b3f2c0f09709d90a94
Diffstat (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c index d6bf1e548..22c360878 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -148,7 +148,7 @@ int bsc_nat_handle_ctrlif_msg(struct bsc_connection *bsc, struct msgb *msg) cmd->reply = "OOM"; goto err; } - ctrl_cmd_send(&pending->ccon->write_queue, cmd); + ctrl_cmd_send(&pending->cmd->ccon->write_queue, cmd); bsc_nat_ctrl_del_pending(pending); } else { /* We need to handle TRAPS here */ @@ -176,7 +176,7 @@ static void pending_timeout_cb(void *data) LOGP(DNAT, LOGL_ERROR, "Command timed out\n"); pending->cmd->type = CTRL_TYPE_ERROR; pending->cmd->reply = "Command timed out"; - ctrl_cmd_send(&pending->ccon->write_queue, pending->cmd); + ctrl_cmd_send(&pending->cmd->ccon->write_queue, pending->cmd); bsc_nat_ctrl_del_pending(pending); } @@ -188,7 +188,7 @@ static void ctrl_conn_closed_cb(struct ctrl_connection *connection) llist_for_each_entry(bsc, &g_nat->bsc_connections, list_entry) { llist_for_each_entry_safe(pending, tmp, &bsc->cmd_pending, list_entry) { - if (pending->ccon == connection) + if (pending->cmd->ccon == connection) bsc_nat_ctrl_del_pending(pending); } } @@ -275,8 +275,7 @@ static int forward_to_bsc(struct ctrl_cmd *cmd) cmd->reply = "Sending failed"; goto err; } - pending->ccon = cmd->ccon; - pending->ccon->closed_cb = ctrl_conn_closed_cb; + cmd->ccon->closed_cb = ctrl_conn_closed_cb; pending->cmd = cmd; /* Setup the timeout */ |