Timur Davydov has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/42421?usp=email )


Change subject: transceiver: return -EINVAL for invalid SETSLOT and preserve 
original behavior
......................................................................

transceiver: return -EINVAL for invalid SETSLOT and preserve original behavior

Change-Id: I90bda68268abdeee9c766a3bf4189fba8f13da53
---
M Transceiver52M/Transceiver.cpp
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/21/42421/1

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index cc60491..28e1d39 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -1022,7 +1022,7 @@
     if ((timeslot < 0) || (timeslot > 7)) {
       LOGCHAN(chan, DTRXCTRL, NOTICE) << "bogus message on control interface";
       snprintf(response, response_size, "RSP SETSLOT 1 %d %d", timeslot, 
corrCode);
-      return 0;
+      return -EINVAL;
     }
     mStates[chan].chanType[timeslot] = (ChannelCombination) corrCode;
     setModulus(timeslot, chan);
@@ -1087,7 +1087,7 @@

   rc = ctrl_cmd_handle(chan, buffer, response, response_size);
   if (rc < 0)
-    return rc;
+    return rc == -EINVAL ? 0 : rc; /* Ignore invalid values, but report other 
errors */

   LOGCHAN(chan, DTRXCTRL, INFO) << "response is '" << response << "'";
   transceiver->ctrl_sock_send(cmd_to_send, chan);

--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/42421?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I90bda68268abdeee9c766a3bf4189fba8f13da53
Gerrit-Change-Number: 42421
Gerrit-PatchSet: 1
Gerrit-Owner: Timur Davydov <[email protected]>

Reply via email to