| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
GSMTAP doesn't have a lot of space for the source file name. It is better to
send only the basename of the file, because only the first bit of a long path
may not convey the source file at all, needing guess work from the line number.
Before: "Source File Name: ../../../../src/libosmocore/src"
After: "Source File Name: telnet_interface.c"
Change-Id: Ie8fc9e782bcf8fa6e2e957d02e7d73c3a7c2bca8
|
|
|
|
|
|
|
|
| |
Previously we've checked for existing log target with a given hostname
from vty code but it was ignored inside the check so only the very first
'log gsmtap' entry was enabled while the rest were silently ignored.
Change-Id: I8fd8bda9e07d403a54735da30addb742e56538a2
|
|
|
|
|
|
|
| |
Print which function has triggered assert_loginfo(). It's handy in
debugging logging-related issues in libosmocore.
Change-Id: I8418d0c431106f50aa8779cd89396f02373304ad
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the length provided in the patcket exceeds the buffer length,
tlv_parse() returns -2 but leaves tlv.val and tlv.len initializd.
Many callers of tlv_parse() do not check its return value, but
rely on TLVP_PRESENT() to see if a particular TLV was parsed
successfully. By clearing tlv.val and tlv.len we make it less
likely that those callers will use an overlong TLV length value.
Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794
|
|
|
|
|
|
|
| |
Used for logging Speech Codec List entries in osmo-bsc, during handover
decision.
Change-Id: Ie6418d16db333188e9bcd2b32b7216f277ae8832
|
|
|
|
|
|
| |
Use bssgp_msgb_tlli_put() instead of copy-pasted code.
Change-Id: I06d60566a19dcae701f8648c19fbd8db6d586f77
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add gsm48_encode_ra() which takes appropriate struct as [out] parameter
instead of generic buffer. Using uint8_t buffer instead of proper struct
type prooved to be error-prone - see Coverity CID57877, CID57876.
Old gsm48_construct_ra() is made into tiny wrapper around new
function. The test output is adjusted because of the change in function
return value which was constant and hence ignored anyway.
Related: OS#1640
Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74
|
|
|
|
|
|
|
|
|
|
| |
As a leftover from code move from OsmoBTS we have eB adjustement outside
of eB check in gsm0503_tch_burst_map() which is rightfully noted by
Coverity. Let's fix this by moving the adjustement under the
corresponding if.
Change-Id: I385cd6ffea4d13ef911910fc87c92b73809888a2
Fixes: CID57691
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the were no default value provided in case of unspecified
hostname in "log gsmtap" vty config. This leads to confusing log
messages because NULL was used as a hostname:
Inconsistent indentation -- leading whitespace must match adjacent lines, and
indentation must reflect child node levels. A mix of tabs and spaces is
allowed, but their sequence must not change within a child block.
Fix this by using 127.0.0.1 as default log destination and logging
hostname in case of errors.
Related: OS#2608
Change-Id: I58b1d4ec522af18024be2e56c9103b3db7936813
|
|
|
|
|
|
|
|
|
| |
Now that we use osmo_sock_get_name() to print connection information
at disconnect, let's use the same also at accept() time.
Furthermore, let's call it CTRL connection everywhere for consistency.
Change-Id: I33ee7d0ed853c5b2a4ae4e8ef945f8f27753cdea
|
|
|
|
|
|
|
| |
We are logging new CTRL connections at LOGL_INFO, so we should
also log disconnects for symmetry.
Change-Id: Id30aa76a5a3dab32d6b4121ce6fdf56d71dfc2ba
|
|
|
|
|
|
|
|
|
|
|
| |
When read() or write() system calls return '0' on a stream socket,
it means that the connection has been closed ("EOF"). We must
accordingly close this socket and remove all related state.
Before this patch, every new CTRL connection would introduce a leak
of both some memory/state, as well as a file descriptor :(
Change-Id: I4fb70e5f123b37dece29f156c5f430c875e7cbaf
|
|
|
|
| |
Change-Id: Ic0c8fc407a45ff4b0d3da1d3e4fdf8885b5bca9b
|
|
|
|
|
|
|
| |
So far, error reporting just says "Trap/Reply", more accurately report 'GET
REPLY', 'SET REPLY' and 'TRAP' as appropriate.
Change-Id: Ic25a251502499aeda4e2952ec4190a1fa0bebb01
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Validate that incoming CTRL commands...
- have decimal IDs,
- return error on trailing characters,
- have invalid characters in variable identifiers,
- send detailed error messages as reply to the requestor.
Adjust ctrl_test.{c,ok}, which best show the change in behavior.
Message handling causes log messages on stderr; previously, stderr was empty.
Add '[ignore]' in testsuite.at so that the nonempty stderr doesn't cause test
failures.
Change-Id: I96a9b6b6a3a5e0b80513aa9eaa727ae8c9c7d7a1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recent patch I563764af1d28043e909234ebb048239125ce6ecd introduced returning
NULL from rate_ctr_group_alloc() when the index passed already exists.
Instead of returning NULL, find an unused group index and use that, adjust the
error message.
In stats_test.c, adjust, and also assert allocated counter group indexes
everywhere.
Rationale:
The original patch causes osmo-sgsn to crash as soon as the second subscriber
attempts to establish an MM context. Of course osmo-sgsn is wrong to a) fail to
check a NULL return value and crash and b) to fail to allocate an MM context
just because the rate counter group could not be allocated (it still rejects
the MM context completely if rate_ctr_group_alloc() fails).
Nevertheless, the price we pay for rate counter correctness is, at least in
this instance, way too high: osmo-sgsn becomes completely unusable for more
than one subscriber.
Numerous other places exist where rate_ctr_group_alloc() is called with a
constant index number; from a quick grep magic I found these possible breaking
points:
osmo-sgsn/src/gprs/gb_proxy.c:1431: cfg->ctrg = rate_ctr_group_alloc(tall_bsc_ctx, &global_ctrg_desc, 0);
osmo-sgsn/src/gprs/gprs_sgsn.c:139: sgsn->rate_ctrs = rate_ctr_group_alloc(tall_bsc_ctx, &sgsn_ctrg_desc, 0);
osmo-sgsn/src/gprs/gprs_sgsn.c:270: ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, 0);
osmo-sgsn/src/gprs/gtphub.c:888: b->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx,
>phub_ctrg_io_desc, 0);
osmo-bsc/src/libfilter/bsc_msg_acc.c:87: lst->stats = rate_ctr_group_alloc(lst, &bsc_cfg_acc_list_desc, 0);
osmo-pcu/src/bts.cpp:228: m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:793: tbf->m_ctrs = rate_ctr_group_alloc(tbf, &tbf_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:879: tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_egprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:880: tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_gprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:970: tbf->m_dl_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_dl_egprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:977: tbf->m_dl_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_dl_gprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:1475: ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, 0);
osmo-pcu/src/bts.cpp:226: m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 1);
We can fix all of these callers and then reconsider returning NULL, but IMO
even into the future, rate counter group indexes are not something worth
failing to provide service for. For future bugs we should keep the automatic
index picking in case of index collisions. We will get an error message barfed
and can fix the issue in our own time, while the application remains completely
usable, and even the rate counters can still be queried (at wrong indexes, but
life is tough).
Related: I49aa95b610f2faec52dede2e4816da47ca1dfb14 (osmo-sgsn's segfault)
Change-Id: Iba6e41b8eeaea5ff6ed862bab3f34a62ab976914
|
|
|
|
|
|
|
|
|
|
|
| |
The recently added ctrl_cmd_parse2() returns non-NULL cmd with error messages
upon parsing errors. In handle_control_read(), use ctrl_cmd_parse2() and send
those back to the CTRL command sender as reply.
Retain the previous "Command parser error" reply only in case ctrl_cmd_parse2()
should return NULL, which shouldn't actually happen at all.
Change-Id: Ie35a02555b76913bb12734a76fc40fde7ffb244d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a control command fails to parse, we so far discard specific error messages
and instead send just "Command parser error".
In ctrl_cmd_parse() we actually compose detailed error replies, but in the end
simply talloc_free() them and return NULL.
A first step to report these errors to the ctrl command issuer is to not return
NULL and instead return the cmd with type = CTRL_TYPE_ERROR. Add
ctrl_cmd_parse2() to return such instead of NULL.
To stay API compatible, provide ctrl_cmd_parse2() to return a cmd on errors.
ctrl_cmd_parse() retains identical behavior but becomes just a simple wrapper
around ctrl_cmd_parse2() which discards the cmd on error.
No need really to deprecate ctrl_cmd_parse() yet; especially as long as
compiler warnings might break jenkins builds.
Change-Id: I5047c9f977d70b03eea77cbcfd2b96d43ea46880
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
In order to allow unit testing the ctrl iface msgb handling, have a separate
msgb entry point function from the actual fd read function.
An upcoming patch will prove a memory leak in CTRL msgb handling by a unit test
that needs this separation.
Change-Id: Ie09e39db668b866eeb80399b82e7b04b8f5ad7c3
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To send a Ciphering Mode Command, we may need to derive a Kc from UMTS AKA
tokens. gsm_milenage() derives Kc from 3G tokens, but also derives an SRES.
For SRES, it requires an OPC, which may need to be derived from OP first. All
we need is a Kc, so we could feed a zero OPC ... but to simplify the function
call for cases where just a Kc is required, separate the c3 function out from
gsm_milenage(), as osmo_auth_c3(). Obviously call osmo_auth_c3() from
gsm_milenage() (meaning that osmo-hlr's 55.205 derived auc tests still cover
exactly that implementation).
Prepares: If04e405426c55a81341747a9b450a69188525d5c (osmo-msc)
Related: OS#2745
Change-Id: I85a1d6ae95ad9e5ce9524ef7fc06414848afc2aa
|
|
|
|
| |
Change-Id: I86b7ccb0931f5a2a489bb8c7c6aee0894a126eb8
|
|
|
|
|
|
|
|
| |
For validating CTRL input, we want to verify that an input variable is a series
of valid osmo_identifier_valid() separated by dots. Allow validating any
additional chars with identifiers, for CTRL vars will be just ".".
Change-Id: I13dfd02c8c870620f937d789873ad84c6b1c45de
|
|
|
|
|
|
| |
In particular disallow ASCII 0..31 (control characters) and 127 (DEL).
Change-Id: I04469988495af03c881fe81d7786ca7f71636299
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I73ac5873ede858da44e1486d8a5c81da1ed5b19f
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Ia4f0606810e00aa6f1779d11893e4acc01976f9a
|
|
|
|
| |
Change-Id: I0c7a414789f8ce6516369327430f71164e2cbd94
|
|
|
|
|
|
| |
This leaves no unnamed chapters in future VTY reference documents.
Change-Id: Iefb8b78094208a1a4c5d70bd6c69a3deca8da54f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 'show online-help' output, add the node names (currently all derived from
the prompt) as <node><name> entry, so that in the osmo-gsm-manuals, each
section of node commands gets a title. So far, each section of commands has no
name at all, and it is entirely up for guessing which part of the VTY the
commands are about.
Node section names, e.g. for OsmoHLR, will be like
1 VTY reference
1.4 config
1.5 config-log
1.6 config-line
1.7 config-ctrl
1.8 config-hlr
1.9 config-hlr-gsup
Before this patch, all but '1 VTY reference' were plain empty.
A better solution would be to list the actual command name that enters the
node, and to nest the commands identically to VTY node nesting, but since this
information is currently hidden in node command implementations, it is
impossible to derive it. So we should actually make the VTY reflect the node
nesting structure in its data model, which would resolve both the accurate node
name problem as well as produce well-structured output to generate the VTY
references from. This patch is a workaround for lack of a more profound fix of
the VTY data model. At least it makes the VTY references' sections even
remotely useful.
Change-Id: Iaf745b2ab3d9b02fc47025a0eba3beb711068bfe
|
|
|
|
|
|
|
| |
In 'show online-help' output, don't list nodes that have no commands (the
'Password' node).
Change-Id: I3bd6883a87b8b893e560ceadfffbf41bc380109c
|
|
|
|
|
|
|
|
|
|
|
| |
We use 'show online-help' to generate VTY reference manuals. It is not helpful
to include the common node commands on each and every node level, it clutters
the actual useful help.
Have a separate first section called 'Common Commands', but omit them
elsewhere.
Change-Id: Ie802eccad80887968b10269ff9c0e9797268e0d4
|
|
|
|
|
|
| |
When creating asciidocs for osmo_counter an empty is not useful.
If there aren't any counter, output a hidden comment
Change-Id: Ie2768100e69dcd7d8d77533688585dd9b43c4a5e
|
|
|
|
| |
Change-Id: I9068231d71876e06d27ee67a688d7fb611ac3a1b
|
|
|
|
|
|
|
| |
Do not attempt to load auth plugins - this does not make sense on
embedded target anyway.
Change-Id: Ie92d2eea21e19e499b3f3bb4d5a82e31fbbea3f0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously ctrl request for all counters in
group (e. g. 'rate_ctr.abs.msc.0') will result in human-readable
description which is not regular enough and is hard to both parse and
generate. The ctrl interface is intended for m2m, not for human
interaction. Let's simplify things by making response similar to counter
group request ('rate_ctr.*').
Reply now looks as follows:
GET_REPLY 9084354783926137287 rate_ctr.abs.msc.0 loc_update_type:attach 0;loc_update_type:normal 0;
Previously it was:
GET_REPLY 9084354783926137287 rate_ctr.abs.msc.0 All counters in msc.0
loc_update_type:attach 0
loc_update_type:normal 0
Change-Id: I7a24cc307450efdcd28168fffe477320c59fcd36
Related: OS#2550
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When calling the timer_cb, that may have effected an fi termination and
deallocation, e.g. from dispatching events and/or complex choices made.
Current timer_cb implementations expect T to reflect the fired timer number, so
we can't actually set T=0 before calling the timer_cb.
Instead, never reset T to zero, let it always reflect the timer that last
fired. When a new timer starts, T will be set to its new value.
Adding a T arg to the timer_cb() would have been the cleanest solution, so that
fi->T can be set to zero before dispatching the timer_cb. But since we've
already rolled out this FSM API, we should stay backwards compatible.
In the case where the timer returned 1 to request termination, we can assume
that the fi still exists, but to be consistent, don't set T = 0 in that code
path either.
Change-Id: I18626b55a1491098b3ed602df1b331f08d25625a
|
|
|
|
|
|
|
| |
Report back expected interval values.
Change-Id: I05ca7f716342af4f7424b28216ed6c1bf2bd589f
Related: OS#2550
|
|
|
|
|
|
|
|
| |
This should never happen with the current code, but if it ever does, we
should log the error instead of silently returning 0.
Change-Id: I544001d3072e5f12a96a67e4178f9b945c5f6b6c
Related: OS#2550
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before user have to know group name and index in advance to request rate
counter value. Introduce introspection function which allows user to
obtain all the groups and their indexes by requesting 'rate_ctr.*'
variable.
This simplifies KPI dumping over ctrl interface.
Change-Id: Ifad8b4f0360c8bcd123a838676516476e84c246a
Related: OS#2550
|
|
|
|
|
|
|
|
| |
Some callers pass NULL and len == 0. The semantics are that we then
nul-terminate an emtpy string. Avoid a sanitizer warning by not calling
memcpy() for the NULL case.
Change-Id: I883048cf2807e606c6481634dbd569fc12aed889
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using the NULL context creates mem leaks that bother sanitizer builds.
Allocate as talloc "child" of the rate_ctr_group, so that the mangled desc (if
any) gets freed when the rate_ctr group is freed.
Remove the comment concerning osmo-msc: the way to fix the unexpected talloc
state in osmo-msc tests is to have no invalid rate counter names in osmo-msc.
See Ib1db8e3dc6c833174f1b0b1ca051b0861f477408 (osmo-msc).
Change-Id: Ief9abfeb78b7706200bcc6aaa5dcb04fbeaa9b5b
|
|
|
|
|
|
| |
Helps fix sanitizer build on debian 9.
Change-Id: Iddf0a6cc733cd81d5f6c1eb62fc079ad319db119
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The accelerated convolutional decoder uses SSSE3 instructions such
as PSIG |