Pau Espin Pedrol has uploaded this change for review. ( 
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(-)



  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/73/9973/1

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: newchange
Gerrit-Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae
Gerrit-Change-Number: 9973
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>

Reply via email to