Change in libosmocore[master]: ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Jul 16 17:56:26 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9983 )

Change subject: ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs
......................................................................

ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs

Change-Id: I396fd1e7548beea31b2b7aa9f764edb765b02941
---
M src/ctrl/control_if.c
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c
index d3e6fac..5962f7e 100644
--- a/src/ctrl/control_if.c
+++ b/src/ctrl/control_if.c
@@ -384,6 +384,7 @@
 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 @@
 
 	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 @@
 	}
 
 	/* 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;

-- 
To view, visit https://gerrit.osmocom.org/9983
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I396fd1e7548beea31b2b7aa9f764edb765b02941
Gerrit-Change-Number: 9983
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180716/30dba4f7/attachment.htm>


More information about the gerrit-log mailing list