Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug in the CLI socket
The
OpenBTS-UMTSCLI
app is unable to locate the socket used for sending commands toOpenBTS-UMTS
appSteps to Reproduce the Bug
Run the OpenBTS-UMTS Application:
./OpenBTS-UMTS
.Run the OpenBTS-UMTSCLI Application:
./OpenBTS-UMTSCLI
.Send command from the CLI app:
OpenBTS-UMTSCLI
app run a command e.grawconfig
.Expected Behavior:
OpenBTS-UMTS
application, and the corresponding response should be displayed.Actual Behavior:
Root Cause
The reason for this problem is the way of saving the path string of the CLI socket.
In
apps/OpenBTS-UMTS.cpp
line 263:The
c_str
function returns a pointer that points to the internal array currently used by thestring
object. However, as we are only using a pointer to the object without retaining thestring
object itself, the pointer refers to an array containing garbage values instead of the correct path (which is/var/run/OpenBTS-UMTS-command
by default). Consequently, rather than opening the socket in the intended path, the code attempts to open the socket file with a nonsensical name in the current directory.Fix
To address this bug, I introduced a new variable to hold the
string
object, and then added another variable of typechar*
to reference the array within the string object. With these changes, the socket now opens correctly in the expected path, allowing the successful transmission of commands fromOpenBTS-UMTSCLI
app.