summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-07-12 19:39:56 +0200
committerHarald Welte <laforge@gnumonks.org>2018-07-16 17:56:25 +0000
commit59e605944755d5b2af52aebf53b070e0ec110c54 (patch)
tree2a3deac7c4097f0971997bcd575b52e9697af92d /src
parent239ed3b3ee4c8a2079c1d5beb9a471deb72692cc (diff)
ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs
Change-Id: I396fd1e7548beea31b2b7aa9f764edb765b02941
Diffstat (limited to 'src')
-rw-r--r--src/ctrl/control_if.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c
index d3e6faca..5962f7eb 100644
--- a/src/ctrl/control_if.c
+++ b/src/ctrl/control_if.c
@@ -384,6 +384,7 @@ close_fd:
int ctrl_handle_msg(struct ctrl_handle *ctrl, struct ctrl_connection *ccon, struct msgb *msg)
{
struct ctrl_cmd *cmd;
+ bool parse_failed;
struct ipaccess_head *iph;
struct ipaccess_head_ext *iph_ext;
int result;
@@ -407,7 +408,7 @@ int ctrl_handle_msg(struct ctrl_handle *ctrl, struct ctrl_connection *ccon, stru
msg->l2h = iph_ext->data;
- cmd = ctrl_cmd_parse2(ccon, msg);
+ cmd = ctrl_cmd_parse3(ccon, msg, &parse_failed);
if (!cmd) {
/* should never happen */
@@ -421,7 +422,7 @@ int ctrl_handle_msg(struct ctrl_handle *ctrl, struct ctrl_connection *ccon, stru
}
/* In case of error, reply with the error message right away. */
- if (cmd->type == CTRL_TYPE_ERROR)
+ if (cmd->type == CTRL_TYPE_ERROR && parse_failed)
goto send_reply;
cmd->ccon = ccon;