diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-07-12 13:37:56 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-07-12 13:37:58 +0200 |
commit | c1a6a967c3b47db74d0f501841932fe1a7d75fef (patch) | |
tree | 17f1f457c2d43709e6ae530383778ca73f52930d /openbsc/src | |
parent | 813fa8e9304afbb927f6a545a32d42f32e9b8ca5 (diff) |
bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error
Instead of always logging/sending same error, use the new
ctrl_cmd_parse2 API which always returns a cmd structure with a specific
error description.
Change-Id: Ie111bec46b664768fe3c3feff906f91e8ee8b1d4
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_msc.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index b2f8806ae..4395c3bfa 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -225,17 +225,9 @@ static void handle_ctrl(struct bsc_msc_data *msc, struct msgb *msg) int ret; struct ctrl_cmd *cmd; - cmd = ctrl_cmd_parse(msc->msc_con, msg); - if (!cmd) { + cmd = ctrl_cmd_parse2(msc->msc_con, msg); + if (cmd->type == CTRL_TYPE_ERROR) { LOGP(DMSC, LOGL_ERROR, "Failed to parse control message.\n"); - cmd = talloc_zero(msc->msc_con, struct ctrl_cmd); - if (!cmd) { - LOGP(DMSC, LOGL_ERROR, "OOM!\n"); - return; - } - cmd->type = CTRL_TYPE_ERROR; - cmd->id = "err"; - cmd->reply = "Failed to parse control message."; ctrl_cmd_send(&msc->msc_con->write_queue, cmd); talloc_free(cmd); |