aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/bsc/bsc_nat.h3
-rw-r--r--src/osmo-bsc_nat/bsc_nat.c2
-rw-r--r--src/osmo-bsc_nat/bsc_nat_ctrl.c9
3 files changed, 5 insertions, 9 deletions
diff --git a/include/osmocom/bsc/bsc_nat.h b/include/osmocom/bsc/bsc_nat.h
index 452daf2ab..6146c002b 100644
--- a/include/osmocom/bsc/bsc_nat.h
+++ b/include/osmocom/bsc/bsc_nat.h
@@ -70,9 +70,6 @@ struct bsc_cmd_list {
/* The NATed ID used on the bsc_con*/
int nat_id;
- /* The control connection from which the command originated */
- struct ctrl_connection *ccon;
-
/* The command from the control connection */
struct ctrl_cmd *cmd;
};
diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c
index a5dbf9716..af97c5701 100644
--- a/src/osmo-bsc_nat/bsc_nat.c
+++ b/src/osmo-bsc_nat/bsc_nat.c
@@ -935,7 +935,7 @@ void bsc_close_connection(struct bsc_connection *connection)
llist_for_each_entry_safe(cmd_entry, cmd_tmp, &connection->cmd_pending, list_entry) {
cmd_entry->cmd->type = CTRL_TYPE_ERROR;
cmd_entry->cmd->reply = "BSC closed the connection";
- ctrl_cmd_send(&cmd_entry->ccon->write_queue, cmd_entry->cmd);
+ ctrl_cmd_send(&cmd_entry->cmd->ccon->write_queue, cmd_entry->cmd);
bsc_nat_ctrl_del_pending(cmd_entry);
}
diff --git a/src/osmo-bsc_nat/bsc_nat_ctrl.c b/src/osmo-bsc_nat/bsc_nat_ctrl.c
index 5d551ac4a..7df3ca3ab 100644
--- a/src/osmo-bsc_nat/bsc_nat_ctrl.c
+++ b/src/osmo-bsc_nat/bsc_nat_ctrl.c
@@ -149,7 +149,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 */
@@ -177,7 +177,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);
}
@@ -189,7 +189,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);
}
}
@@ -276,8 +276,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 */