Change in openbsc[master]: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error

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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Jul 12 19:03:10 UTC 2018


Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9973 )

Change subject: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error
......................................................................

nat: 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: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae
---
M openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
1 file changed, 2 insertions(+), 11 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Neels Hofmeyr: Looks good to me, approved



diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
index 61ac887..af110a2 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
@@ -103,20 +103,11 @@
 	struct bsc_cmd_list *pending;
 	char *var;
 
-	cmd = ctrl_cmd_parse(bsc, msg);
+	cmd = ctrl_cmd_parse2(bsc, msg);
 	msgb_free(msg);
 
-	if (!cmd) {
-		cmd = talloc_zero(bsc, struct ctrl_cmd);
-		if (!cmd) {
-			LOGP(DNAT, LOGL_ERROR, "OOM!\n");
-			return -ENOMEM;
-		}
-		cmd->type = CTRL_TYPE_ERROR;
-		cmd->id = "err";
-		cmd->reply = "Failed to parse command.";
+	if (cmd->type == CTRL_TYPE_ERROR)
 		goto err;
-	}
 
 	if (bsc->cfg && !llist_empty(&bsc->cfg->lac_list)) {
 		if (cmd->variable) {

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

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae
Gerrit-Change-Number: 9973
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180712/23623042/attachment.htm>


More information about the gerrit-log mailing list