Review at  https://gerrit.osmocom.org/6718

host/trxcon/trx_if.c: simplify response matching

Previously, we had both length and string matching of request and
response. To be able to implement commands with additional params
in the future, this change drops the length matching part.

Change-Id: Id4c50115f5f1b1da450ff8b8dcfd6ccf572d23f5
---
M src/host/trxcon/trx_if.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/18/6718/1

diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index c387bc1..c66bb4c 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -458,7 +458,7 @@
                struct trx_ctrl_msg, list);
 
        /* Check if response matches command */
-       if (rsp_len != tcm->cmd_len || !!strncmp(buf + 4, tcm->cmd + 4, 
rsp_len)) {
+       if (!!strncmp(buf + 4, tcm->cmd + 4, rsp_len)) {
                LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_ERROR,
                        "Response message '%s' does not match command "
                        "message '%s'\n", buf, tcm->cmd);

-- 
To view, visit https://gerrit.osmocom.org/6718
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4c50115f5f1b1da450ff8b8dcfd6ccf572d23f5
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>

Reply via email to