| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
In ctrl_handle_msg() (code recently propagated from handle_control_read()),
talloc_free() the parsed ctrl_cmd in all code paths. In particular, a free was
missing in case ctrl_cmd_handle() returns CTRL_CMD_HANDLED.
CTRL_CMD_HANDLED is triggered by GET_REPLY / SET_REPLY parsing, as show by
ctrl_test.c. With the memleak fixed, adjust expected test output and make a
detected mem leak abort the test immediately.
Change-Id: Id583b413f8b8bd16e5cf92a8a9e8663903646381
|
|
|
|
|
|
|
| |
The "memleak!" output shows messages that lack a talloc_free() of the parsed
ctrl command buffer. The leak shall be fixed in a subsequent patch.
Change-Id: I2c3e4d08b769b9cd77593362ea36a28d681cd042
|
|
|
|
|
|
|
| |
Subsequent patches that tighten CTRL input validation will make the results
more interesting.
Change-Id: Idd4cc7d193db1a7d761f72ed33ed46eea450a78f
|
|
|
|
| |
Change-Id: I12d3828dcc925f97fde11c360f1d60f3bd8cad8b
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To report invalid characters in identifiers, it is desirable to escape any
weird characters. Otherwise we might print stray newlines or control characters
in the log output.
ctrl_test.c already uses a print_escaped() function, which will be replaced by
osmo_escape_str() in a subsequent patch.
control_cmd.c will use osmo_escape_str() to log invalid identifiers.
Change-Id: Ic685eb63dead3967d01aaa4f1e9899e5461ca49a
|
|
|
|
|
|
|
|
| |
Check that no group with the given name and index already exist before
allocating it. Add corresponding test case.
Change-Id: I563764af1d28043e909234ebb048239125ce6ecd
Related: OS#2757
|
|
|
|
|
|
|
|
|
| |
The Cause IE in the 08.08 CIPHER MODE REJECT is a normal TLV IE,
and not just a value. Let's make sure we encode the cause value
properly.
Change-Id: I4f5b231edf6dcb0a9c2bbafb2a59f301f3b2402b
Closes: OS#2766
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for extended RACH (11 bit) according 3GPP TS 45.003 ยง5.3.2:
* convolutional code with puncturing
* encoding/decoding routines
* corresponding tests
Change-Id: I85a34a82d5cd39a594ee89d91a2338226066ab5d
Related: OS#1548
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some Abis/RSL messages such as "Release Indication" contained 3 extra
bytes from an L3 Information header which should not be there according
to specs in GSM 08.58 (section 8.3 "Radio link layer management
messages"). Other RSL messages were affected by the same issue, except
for "Establish Indication", which had already a workaround in
send_rslms_dlsap.
This commit fixes the issue in a generic way, removes the "Establish
Indication" and fixes the test accounting for the bug, as it otherwise
fails after applying the changes.
Fixes: OS#1635, OS#2336
Change-Id: Ibb116214e8b1798d65a8b0917150496a3c14f344
|
|
|
|
|
|
|
|
| |
This was always intended to be GPL and not AGPL. "kat" did the
development as part of an internship paid by me and we agreed
to shared copyright.
Change-Id: Ied2041ba20c5737bd967dfaa3017edf72a95b31c
|
|
|
|
|
|
|
|
|
|
|
| |
The external sercomm_drv_[un]lock() functions are defined as stubs in
case of non-embedded build only which causes linking issue with
sercomm_test. Let's define the same stubs in sercomm_test
unconditionally - the implementation details of the locking are
irrelevant for the test anyway.
Related: OS#2708
Change-Id: I3dab4f3348871b66b5d6c9fd10b2e448c61f9e73
|
|
|
|
|
|
|
|
|
|
|
| |
In case of embedded build some tests are failing to link properly. Fix
it:
* do not run fsm_test unless CTRL is enabled
* do not run fr_test unless GB is enabled
* do not link loggingrb_test with libosmovty
Change-Id: Icedad5ba3ed311ccdb97fa3ccd3002f5fda8be68
|
|
|
|
| |
Change-Id: I896d6aaae3c36b87243b7dc270267090dcb44afe
|
|
|
|
| |
Change-Id: I65c75e56831420d3daf386ea280c13ae9cb64d1b
|
|
|
|
| |
Change-Id: I1ec23ca3cf0d973c77b8c4e7e23e0e75a4f0a7a3
|
|
|
|
|
|
|
|
|
| |
* remove duplicate code: use function from libosmocore
* use utility function to dump ubits
* reformat for easier reading
* link against libosmocore
Change-Id: I8c31b0954176a2c53305936a025c92a793b6d9b6
|
|
|
|
|
|
|
|
|
| |
This should fix the last current remaining sanitizer build failure in
libosmocore regression tests.
Helps fix sanitizer build on debian 9.
Change-Id: I4d6dd7f4348675bc77d4df5a7a0ce41f12d4a043
|
|
|
|
|
|
| |
Helps fix sanitizer build on debian 9.
Change-Id: I0ef95ee8185a4789f0732b9420243dda5104d181
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All successful and all error code paths of bssgp_fc_in() free the msgb, except
the code path calling fc_enqueue() when the msg is dropped (due to queue being
full, or failure to allocate).
Callers could theoretically catch the -ENOSPC return value and discard the
msgb. However, in other code paths, a callback's return value is returned,
which is expected to free the msgb, so such callback would have to never return
-ENOSPC when it freed the msgb. Much simpler semantics would be to free the
msgb in every code path, no matter which kind of error occurred.
Who is currently calling bssgp_fc_in and how do they handle the return value?
- bssgp_fc_test.c ignores the return value (and hits a mem leak aka sanitizer
build failure if the queue is full).
- fc_timer_cb() ignores the return value.
- bssgp_tx_dl_ud() returns the bssgp_fc_in() rc.
- which is returned by a cascade of functions leading up to being returned,
for example, by gprs_llgmm_reset(), which is usually called with ignored
return code.
At this point it is already fairly clear that bssgp_fc_in() should always free
the msgb, since the callers don't seem to distinguish even between error or
success, let alone between -ENOSPC or other errors.
bssgp_fc_test: assert that no msgbs remain unfreed after the tests.
Adjust expected results.
Helps fix sanitizer build on debian 9.
Change-Id: I00c62a104baeaad6a85883c380259c469aebf0df
|
|
|
|
|
|
|
|
|
|
|
|
| |
Print remaining msgbs when done, then free the entire tall_msgb_context. To be
able to do that, call msgb_talloc_ctx_init() and use its return value.
A subsequent patch will fix a known mem leak and add assertions for 0b in 1
blocks remaining in the tall_msgb_context.
Helps fix sanitizer build on debian 9.
Change-Id: I67d347ab2642b0bfc27b21b44231a7f3146ff641
|
|
|
|
|
|
|
|
|
|
|
| |
The test fills up the queue / sends too large PDUs on purpose. Make that
obvious by outputting returned errors in the expected output.
Cosmetic:
- fc_in()'s return value is ignored, hence don't return anything.
- add comment.
Change-Id: I57d6fce2515a65f6dd037e75af5397079215cb46
|
|
|
|
|
|
|
|
| |
Ever since this test was changed to use osmo_gettimeofday_override, the times
it sees are exact every time and don't need rounding to pass the expected
output.
Change-Id: I4a9a5d31fc02eb55caf7ba9c141426d8115bb740
|
|
|
|
|
|
| |
Helps fix sanitizer build on debian 9.
Change-Id: I0097d63bbb4e7ee20eb4a8474f4fef32d39e625f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove initial msgb talloc context creation: if we create a root ctx for msgb
that all msgb are allocated in, we would in a final cleanup discard all msgbs,
i.e. we would not verify that all msgb are cleaned up properly.
If we create the msgb context and *don't* clean it up in the end, the sanitizer
build fails because the context root is not cleaned up.
Easiest is to actually allocate all msgb at NULL ctx, because then any msgb
that aren't cleaned up properly would still linger, while we don't leave a root
ctx that we need to clean up either.
Helps fix sanitizer build on debian 9.
Change-Id: I1f2d1d05c75bbf4d92787f9735083f18cdc90f6f
|
|
|
|
|
|
| |
Helps fix sanitizer build on debian 9.
Change-Id: I0add9eac7225db23bc02fc2aaee5f42258d34e25
|
|
|
|
|
|
| |
Helps fix sanitizer build on debian 9.
Change-Id: I69750d9cd2b8f30bfc6d2dfd9e62576e46989fab
|
|
|
|
|
|
|
|
| |
The testsuite fails on some specific build machines in the OBS
build cluster. Let's try to figure out which CPU flags they have
to narrow down the cause of this.
Change-Id: Ib23e5bfb3c894206fad62d6cc6151583b1bb75a6
|
|
|
|
|
|
|
|
| |
Let's fix some erroneous/accidential references to wrong license,
update copyright information where applicable and introduce a
SPDX-License-Identifier to all files.
Change-Id: I39af26c6aaaf5c926966391f6565fc5936be21af
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to
https://www.gnu.org/software/automake/manual/automake.html#Libtool-Flags
the libraries supposed to be added to *_LDADD or *_LIBADD
while *_LDFLAGS should contain additional libtool linking
flags. Previously we used both. Let's unify this and move all the
libraries into proper automake variable. While at it - also add
libosmocore.la for tests to LDADD since all the tests link against it
anyway.
Change-Id: Ia657a66db75df831421af5df1175a992da5ba80f
|
|
|
|
|
|
|
|
| |
Sounds stupid, but we actually didn't support hex nibbles in one of
the two directions of the conversion, so let's make sure we test for
this.
Change-Id: I8445da54cc4f9b1cd64f286c2b238f4f7c87accb
|
|
|
|
|
|
|
|
|
| |
In Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 we introduce
name mangling to replace any '.' in counter (group) names to be
converted to ':'. Let's test for this functionality explicitly as part
of the stats_test.
Change-Id: Ie35682aa79526e2ffeab6995cd640b7847d855bf
|
|
|
|
|
|
|
|
| |
The rate_ctr.c code would do this mangling automatically, but let's
avoid using this from new versions of our code for
simplicity/explicitness.
Change-Id: I24a556f447cfac25efb6e83cac2d0c2972d98fe3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As rate counters are automatically exposed on the CTRL interface,
we need to make sure they don't contain special characters such as '.'
which are not permitted/supported by CTRL.
In order to be able to run old versions of osmocom programs with
libosmocore versions after this commit, we introduce some special
name mangling: Any '.' in the names are replaced with ':' during
counter group registration, if valid identifiers can be obtained
this way.
Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56
|
|
|
|
|
|
|
|
|
| |
* introduce defines with NS state names
* use them for vty and tests
* expand test output to print complete NS state
Change-Id: I69f8d536135ae76dbca623c2f1ffba625adcb1e9
Related: SYS#3610
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function is actively used by OsmoPCU but have not been covered by
tests so far. The test code is based on
Minh-Quang Nguyen <minh-quang.nguyen@nutaq.com> submission with some
modifications.
The test's FIXME will be addressed in follow-up patches.
Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90
Related: OS#1526
|
|
|
|
|
|
|
|
|
|
|
| |
In ASCII string based protocols it a printf() version that prints
directly to the message buffer may be useful.
Add function msgb_printf(), make sure that msg buffer bounderies
are not exceeded. If the end of the tail buffer is hit, return
with an error code.
Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3
|
|
|
|
|
|
|
| |
Previously it would crash on NULL input. Let's handle it gracefully
instead. Corresponding test case is also added.
Change-Id: I587153e49d1c92128fac3ae5c124adba9592378e
|
|
|
|
|
|
|
|
|
| |
No callers that would pass NULL exist, but let's check against NULL from the
start.
Fixup for recent change I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522.
Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e
|
|
|
|
|
|
| |
Will be used by OsmoHLR to validate VTY and CTRL input.
Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a
|
|
|
|
|
|
|
|
|
| |
Add GSM23003_IMSI_MIN_DIGITS definition.
Add regression test gsm23003_test.c to test the two new functions.
Will be used by OsmoHLR to validate VTY and CTRL input.
Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522
|
|
|
|
|
|
|
|
| |
This uncovers some interesting behavior of the CTRL interface which we may want
to guard against in subsequent patches: trailing whitespace, ignored tokens,
special characters as cmd->id.
Change-Id: If7af06d50ca71fd528b08cd70310774d5a53f0f7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In many callers of the VTY API, we are lacking the vty_install_default() step
at certain node levels. This creates nodes that lack the 'exit' command, and
hence the only way to exit such a node is to restart the telnet session.
Historically, the VTY looked for missing commands on the immediate parent node,
and hence possibly found the parent's 'exit' command when the local node was
missing it. That is why we so far did not notice the missing default commands.
Furthermore, some callers call install_default() instead of
vty_install_default(). Only vty_install_default() also includes the 'exit' and
'end' commands. There is no reason why there are two sets of default commands.
To end this confusion, to catch all missing 'exit' commands and to prevent this
from re-appearing in the future, simply *always* install all default commands
implicitly when calling install_node().
In cmd_init(), there are some top-level nodes that apparently do not want the
default commands installed. Keep those the way they are, by changing the
invocation to new install_node_bare() ({VIEW,AUTH,AUTH_ENABLE}_NODE).
Make both install_default() and vty_install_default() no-ops so that users of
the API may still call them without harm. Do not yet deprecate yet, which
follows in Icf5d83f641e838cebcccc635a043e94ba352abff.
Drop all invocations to these two functions found in libosmocore.
Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In vty_test, add three levels of parent nodes (level1, level2, level3) with
each having a leaf child (child1, child2, child3).
Use these to enhance the vty_test cfg files and test more diverse situations.
The current VTY code expects a go_parent_cb() to be present, otherwise it will
bump right back to the CONFIG_NODE, which will not work with more than one node
level below the CONFIG_NODE. Hence provide a minimal go_parent_cb().
Change-Id: Ib9bcf58b655fbd85e196f363fb7d8305d7dfc997
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The recent exit-by-indent patch breaks a VTY case where a node is entered but
directly followed by a sibling or ancestor without listing any child nodes.
Regression introduced by I24cbb3f6de111f2d31110c3c484c066f1153aac9.
An example is a common usage in osmo-bts, where 'phy N' / 'instance N' is a
parent node that is commonly left empty:
phy 0
instance 0
bts 0
band 1800
Before this patch, this case produces the error:
There is no such command.
Error occurred during reading the below line:
bts 0
Fix indentation parsing logic in command.c to accomodate this case.
Add a unit test for empty parent node.
Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note: This will break users' config files if they do not use consistent
indenting. (see below for a definition of "consistent".)
When reading VTY commands from a file, use indenting as means to implicitly
exit child nodes. Do not look for commands in the parent node implicitly.
The VTY so far implies 'exit' commands if a VTY line cannot be parsed on the
current node, but succeeds on the parent node. That is the mechanism by which
our VTY config files do not need 'exit' at the end of each child node.
We've hit problems with this in the following scenarios, which will show
improved user experience after this patch:
*) When both a parent and its child node have commands with identical names:
cs7 instace 0
point-code 1.2.3
sccp-address osmo-msc
point-code 0.0.1
If I put the parent's command below the child, it is still interpreted in the
context of the child node:
cs7 instace 0
sccp-address osmo-msc
point-code 0.0.1
point-code 1.2.3
Though the indenting lets me assume I am setting the cs7 instance's global PC
to 1.2.3, I'm actually overwriting osmo-msc's PC with 1.2.3 and discarding the
0.0.1.
*) When a software change moves a VTY command from a child to a parent. Say
'timezone' moved from 'bts' to 'network' level:
network
timezone 1 2
Say a user still has an old config file with 'timezone' on the child level:
network
bts 0
timezone 1 2
trx 0
The user would expect an error message that 'timezone' is invalid on the 'bts'
level. Instead, the VTY finds the parent node's 'timezone', steps out of 'bts'
to the 'network' level, and instead says that the 'trx' command does not exist.
Format:
Consistent means that two adjacent indenting lines have the exact
same indenting characters for the common length:
Weird mix if you ask me, but correct and consistent:
ROOT
<space>PARENT
<space><tab><space>CHILD
<space><tab><space><tab><tab>GRANDCHILD
<space><tab><space><tab><tab>GRANDCHILD2
<space>SIBLING
Inconsistent:
ROOT
<space>PARENT
<tab><space>CHILD
<space><space><tab>GRANDCHILD
<space><tab><tab>GRANDCHILD2
<tab>SIBLING
Also, when going back to a parent level, the exact same indenting must be used
as before in that node:
Incorrect:
ROOT
<tab>PARENT
<tab><tab><tab>CHILD
<tab><tab>SIBLING
As not really intended side effect, it is also permitted to indent the entire
file starting from the root level. We could guard against it but there's no
harm:
Correct and consistent:
<tab>ROOT
<tab><tab>PARENT
<tab><tab><tab><tab>CHILD
<tab><tab>SIBLING
Implementation:
Track parent nodes state: whenever a command enters a child node, push a parent
node onto an llist to remember the exact indentation characters used for that
level.
As soon as the first line on a child node is parsed, remember this new
indentation (which must have a longer strlen() than its parent level) to apply
to all remaining child siblings and grandchildren.
If the amount of spaces that indent a following VTY command are less than this
expected indentation, call vty_go_parent() until it matches up.
At any level, if the common length of indentation characters mismatch, abort
parsing in error.
Transitions to child node are spread across VTY implementations and are hard to
change. But transitions to the parent node are all handled by vty_go_parent().
By popping a parent from the list of parents in vty_go_parent(), we can also
detect that a command has changed the node without changing the parent, hence
it must have stepped into a child node, and we can push a parent frame.
The behavior on the interactive telnet VTY remains unchanged.
Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For interactive telnet VTY, remove the implicit move up to the parent node when
a command did not succeed on the current node level.
When reading config files, this behavior was useful to allow skipping explicit
'exit' commands. (A different patch deals with that.)
In the telnet VTY, this behavior was never necessary. Explicit 'exit' commands
can move to the parent node, and typically uninformed users expect to require
that.
On a telnet VTY, counting indents like for reading config files is not an
option: a user will always type from the first column or may paste some leading
spaces without intended meaning.
After this patch, it is thus no longer possible to paste a complete config
across several node levels directly to a telnet session, unless it contains
'exit' commands.
Change-Id: Id73cba2dd34676bad8a130e9c45e67a272f19588
|
|
|
|
|
|
| |
Ensure that gsm48_parse_ra() and gsm48_construct_ra() behave properly.
Change-Id: I27117fe728407dd10886459e89ba4ff9d5e53e6b
|