Commit Graph

722 Commits

Author SHA1 Message Date
Pau Espin ff8c223440 Workaround ASan report memleak during call to --vty-ref-xml
For some unknown reason, using size=0 instead of 1 makes LeakSanitizer
report a leak when calling osmo-hnbgw --vty-ref-xml:
"""
==19857==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x7f083b4d0d28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28)
    #1 0x7f083a8e5661 in talloc_named_const (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x6661)
"""

It seems iu_client.c is already using size=1.

Change-Id: I383653c981e68a053babd33dee1f0df8731752b0
2021-02-23 19:55:03 +01:00
Pau Espin 79d001fcb6 hnbgw: Avoid re-defining same global variable twice
This global variable is already defined in iu_client.c provided by
libosmo-ranap (and used by libasn1c).
Fixes ASan warning at starutp.

Change-Id: I7dbae83ce0dc4ac25dc10879e223280414f7b561
2021-02-23 19:08:48 +01:00
Harald Welte d24839fea0 main: add --vty-ref-mode, use vty_dump_xml_ref_mode()
Change-Id: If07b00e928fbecc596a7f75fc55e811bd9199b72
Depends: Ie2022a7f9e167e5ceacf15350c037dd43768ff40
Relates: OS#5041
2021-02-23 17:44:47 +01:00
Pau Espin a94752e684 tests: Replace deprecated API log_set_print_filename
Change-Id: Ic53a0a9afb8038759bb3ab1d4c5970f23632e84e
2021-02-19 13:19:01 +01:00
Pau Espin 2c6aed38bd tests: Explicitly drop category from log
Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: Ia633cae0a26f294e276b431a82256abb1b57ebba
Related: OS#5034
2021-02-19 13:18:42 +01:00
Harald Welte e8299eb745 ranap_msg_factory: Fix LOGP statements
The related compiler warnings were overlooked as due to the
asn1c-generated code there always are tons of warnings printed compiling
this project :(

Change-Id: I40b1265ba696501cc72e674f3ef4146c47aacf1b
2021-02-11 10:15:37 +01:00
Harald Welte e3f707b8c6 ranap_msg_factory: Allow detailed control over UEA/UIA algorithm encoded
Change-Id: I6d2d033b0427bdc84fee61e0f3cb7b29935214bf
Closes: OS#4143
2021-02-08 18:34:02 +01:00
Harald Welte f05c5bf6cd hnbgw: Use LOGHNB() to add log context information to log lines
So far we don't really have any way of matching a given log message
to a specific hNB.  Let's use the newly-introduced LOGHNB() macro.

Change-Id: Ia16eed4ca5e9ef231259e94c65105f7586f366bc
2021-02-03 08:45:04 +00:00
Oliver Smith dee13c345f configure.ac: set -std=gnu11
Change-Id: I4bf2f1cb724bc3e3c56d5a5c1270bb152b0e6e0a
2021-01-28 09:28:31 +00:00
Pau Espin e6342e1cab tests/hnb-test: Disable building unsued code
Change-Id: I17f20cea8aa63ed79168653292b99c90b8c03caf
2021-01-14 11:31:32 +01:00
Pau Espin 8653233b57 tests/hnb-test: Initialize logging with existing struct log_info
Change-Id: Ic92e60dda41a9e4d139294b1e851fff5c4f26143
2021-01-14 11:29:47 +01:00
Pau Espin 4c928485ba tests/hnb-test: Fix signedness of assigned pointer
Change-Id: I320ad86b83b0308b43489e8d95f63d6ed55821b5
2021-01-14 11:27:34 +01:00
Pau Espin 84c3e8649a tests/hnb-test: Fix uninitialized use of rc variable
Change-Id: I168e4f7cd48cbaa387e6b05868107250795a0f0c
2021-01-14 11:26:15 +01:00
Pau Espin 634fd81f3d tests/hnb-test-ranap: Fix missing include for ranap_bcd_decode
Change-Id: If8b799777598377048512c338f6384560b445ba3
2021-01-14 11:26:15 +01:00
Pau Espin 101fba211a tests/hnb-test-ranap: Fix incorrect signedness in pointer
Change-Id: I04b1c0446124d66dae1e8fb99d9b82782d12bde7
2021-01-14 11:26:15 +01:00
Pau Espin 96a94bc482 tests/hnb-test: check return code of hnbap_encode_ueregisterrequesties
gcc warns about set but not used variable otherwise.

Change-Id: Ia49b7e88a66a4a744c2b14db6331cc0de431f60b
2021-01-14 11:26:15 +01:00
Pau Espin b4ff1f42b8 tests/hnb-test: Fix signedness of imsi_buf
Change-Id: I3b0a6218ac6242d03642972d5b244815ce9d97a0
2021-01-14 11:26:15 +01:00
Pau Espin 89f4c80541 tests/hnb-test: Drop unused variables
Change-Id: I12870a1cf2462b7cc2868a54f58416e03a856084
2021-01-14 11:24:31 +01:00
Pau Espin 825a1e40a8 tests/hnb-test-ranap: Fix incorrect pointer type cast
osmo_hexdump expect it to be a const unsigned char*, and gcc warns about
incorrect signedness.

Change-Id: I7e0622f502a4442d700340b0f1c2f8cd01e90ecd
2021-01-14 11:10:08 +01:00
Oliver Smith 220f0e2d94 contrib/jenkins: don't build osmo-gsm-manuals
Related: OS#4912
Change-Id: I339cc37a259e30b131fadbdaebd413c54b04f0a0
2021-01-13 13:11:33 +01:00
Harald Welte d37d3c8181 configure.ac: Ensure netinet/sctp.h is present
we unconditionally depend on this header file, yet nothing
in configure.ac ensures its presence.  Building on a clean
Debian 10 with all existing dependencies installed passes
configure but fails at compilation time.

Change-Id: I0a4407ef6ee512ad5ea8775d90acfe1c4fa67cd0
2021-01-07 13:56:26 +01:00
Harald Welte 3f70fcd417 debian: Actually build manuals; add osmo-hnbgw-doc package
for some strange reason we didn't yet build the manual in the debian
package build.

Change-Id: Id53956494144b46e78fc25a176a9b8917788d86e
2021-01-07 13:56:26 +01:00
Harald Welte c6d93452b2 hnbgw: Introduce LOGHNB() macro for log context information
So far we don't really have any way of matching a given log message
to a specific hNB.  Let's introduce a new log macro, together with
a configuration directive to select whether the hNB-ID or the
UMTS CellID shall be used.

Change-Id: I6113925216c6f88add2c6d27bdf47ccbb017f293
2020-12-30 14:23:54 +01:00
Harald Welte dc529f3d78 hnbgw: use OSMO_STRLCPY_ARRAY() instead of open coding it
Change-Id: I4c539168597187408c31b906fd57844e0f165c9b
2020-12-30 14:23:54 +01:00
Pau Espin 294610160d contrib/jenkins: Enable parallel make in make distcheck
Change-Id: I38f59aec482d3a8e2690913bc55728a96399659e
Related: OS#4421
2020-10-13 08:21:51 +00:00
Pau Espin 4875f09f85 hnbgw: Mark SCTP conn as NODELAY
We don't want messages to be sent being delayed.

Related: OS#4499
Change-Id: I333e7f868e426f7d7ebb328ea2a441d769ea8ebd
2020-10-12 16:04:18 +02:00
Vadim Yanitskiy 83417696da vty: use install_lib_element() and install_lib_element_ve()
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html.

Change-Id: I5c0a1efc21a5cc085b701be24dbcca1aaae15ee6
Depends: I8baf31ace93c536421893c2aa4e3d9d298dcbcc6
Related: SYS#4937
2020-10-04 16:48:47 +07:00
Pau Espin 9074d91451 Change default SCTP conn NULL->127.0.0.1 to localhost->localhost
"127.0.0.1" is changed to "localhost" to let local NSS decide whether to
use IPv4 or IPv6. In newish systems, IPv6 ::1 will be selected since
IPv6 takes precedence over IPv4.

Similarly, the default source addr needs to be changed from NULL to "localhost"
since for some yet unknwon reason, getaddrinfo(AF_UNSPEC, NULL) returns
first IPv4 "0.0.0.0" and later "::", which is inconsistent with
getaddrinfo("localhost") result, resulting in src=IPv4(0.0.0.0) and
dst=IPv6(::1), which is incompatible and will fail. In any case, since
the default remote address is a local one and it's the client side,
there's no real logical change since the kernel would anyway should have
taken a local address anyway.

Change-Id: I3c07e6aa0c87b752c9ea22eb4936f6993de6571f
2020-08-21 18:07:26 +02:00
Vadim Yanitskiy 9922e083ea debian/control: change maintainer to the Osmocom team / mailing list
Change-Id: If6e115ca23ae29696edf74ae010035e85aaa085c
2020-08-13 16:09:02 +07:00
Harald Welte 4f18ce1ecc Provide more context when logging "Error in ANY_fromType_aper"
Let's add the type name whose encoding failed to give us some kind
of a clue what's happening in those situations.

Change-Id: I802677ba7164a4d3382d4bc00f5e1c7ab7067d89
2020-07-29 20:11:36 +02:00
Oliver Smith c879975742 Makefile.am: EXTRA_DIST: debian, contrib/*.spec.in
Change-Id: I8573098cc7dd2d8920914f93490c5ddf978418b0
2020-05-22 13:41:00 +02:00
Oliver Smith 70abda0ab2 contrib: integrate RPM spec
Remove OpenSUSE bug report link, set version to @VERSION@, make it build
with CentOS 8 etc.

Related: OS#4550
Change-Id: Ibec1a22952ecfb0578bb4611e65ad819f5984fd8
2020-05-20 08:50:55 +00:00
Pau Espin 4f35665b9f Fix OneDefinitionRule Asan violation in tests and osmo-hnbgw
With new gcc 10.1.0, tests failed at runtime when built with ASAN
enabled, since some global variables where defined multiple times.
See OS#4556 for a sample Asan error.

Fixes: OS#4556
Change-Id: I12a667ea8a9f16404c13c9218b246d2e3acfe3e8
2020-05-19 20:32:58 +00:00
Pau Espin 6f66feb42d tests: Fix trailing whitespace
Change-Id: I3ef7a3f1c3247615619a0d01c92d8f80572b0dfe
2020-05-19 20:32:58 +00:00
Oliver Smith 0e3a02776c contrib: import RPM spec
Copy the RPM spec file from:
https://build.opensuse.org/project/show/home:mnhauke:osmocom:nightly

Related: OS#4550
Change-Id: Ic3f146c1eb5b5d02277ec869516a1ec95987d4cd
2020-05-14 11:46:12 +02:00
Harald Welte 7712808e07 Fix compilation with gcc-10
/usr/bin/ld: test_common.o:(.bss+0x0): multiple definition of `talloc_asn1_ctx'; test-helpers.o:(.bss+0x0): first defined here

See also https://alioth-lists.debian.net/pipermail/debian-mobcom-maintainers/Week-of-Mon-20200413/000652.html

Change-Id: I4ce41158bb27e6b9242613106f226fc86995c53c
2020-04-20 20:01:53 +02:00
Philipp Maier 554dbf4fb7 hnbgw: do not use LOGL_DEBUG as default loglevel
The hnbgw application uses LOGL_DEBUG for all its log categories. This
is way to verbose, lets set LOGL_NOTICE as default loglevel instead.

Change-Id: If3dbed88307814764bab9e7f1821e1dc0d8be43b
Related: OS#2577
2020-04-14 13:19:52 +00:00
Eric Wild 8d88271570 configure.ac: fix libtool issue with clang and sanitizer
As pointed out at https://github.com/libexpat/libexpat/issues/312
libtool does not play nice with clang sanitizer builds at all.
For those builds LD shoud be set to clang too (and LDFLAGS needs the
sanitizer flags as well), because the clang compiler driver knows how
linking to the sanitizer libs works, but then at a later stage libtool
fails to actually produce the shared libraries and the build fails. This
is fixed by this patch.

Addtionally LD_LIBRARY_PATH has no effect on conftest runs during
configure time, so the rpath needs to be set to the asan library path to
ensure the configure run does not fail due to a missing asan library,
i.e.:

SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan'
export CC=clang-10
ASANPATH=$(dirname `$CC -print-file-name=libclang_rt.asan-x86_64.so`)
export LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS"

Change-Id: I74cdca5c8bd5a32b6fb05906280cc1cdd64e9369
2020-04-11 01:18:34 +02:00
Vadim Yanitskiy 065c192475 tests/test-ranap: cosmetic: remove unused variable 'rc'
Change-Id: Ie931d11efd7bb083558852a7f329c984c17fec62
2020-04-07 21:11:13 +07:00
Vadim Yanitskiy 81fd48d741 tests/test-helpers: fix endianness: do not print uint32_t as raw bytes
This unit test would not pass on big-endian machines.

Change-Id: I60dbcaa89b031c9a81c35e1dd0d9c963d486014c
2020-04-07 21:05:37 +07:00
Vadim Yanitskiy 89062aeb21 tests/test-helpers: fix some -Wpointer-sign warnings reported by GCC
Change-Id: I7ebc99fe919fe7ba515c9d8ba601dceb820bf11f
2020-04-07 21:01:12 +07:00
Neels Hofmeyr a959dd90d2 manual: link to new common cs7-config.adoc
Related: OS#2767
Depends: Ia2508d4c7b0fef9cdc57e7e122799a480e340bf7 (osmo-gsm-manuals)
Change-Id: I531b272f49edcbf4194603e554b535b83a1e5780
2020-03-30 18:19:33 +02:00
Neels Hofmeyr 50865f8a6f manual: add "Configuring Primary Links" and "Multiple instances"
Change-Id: I0919392b716e2812ff19d7efa5d1ba535b08eb91
2020-03-30 18:19:30 +02:00
Pau Espin 35e2058348 hnbgw_vty.c: Drop unusued variables
Change-Id: Ic7f730c9f51384006e471b5e8452f5821b458bbf
2020-03-20 20:35:06 +01:00
Pau Espin a008b17f2e Fix compiler warning on signedness of char ptr using OCTET_STRING_fromBuf()
rua_msg_factory.c:19:48: warning: pointer targets in passing argument 2 of ‘OCTET_STRING_fromBuf’ differ in signedness [-Wpointer-sign]

Change-Id: Ie0a2e8e11902dc56720ff8121edde0e148fa587a
2020-03-20 20:32:26 +01:00
Pau Espin ca74126d54 tests/test-ranap.c: Fix wrong printf format
Caught by compiler:
test-ranap.c:54:30: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘RANAP_MaxBitrate_t’ {aka ‘long int’} [-Wformat=]
test-ranap.c:78:30: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘RANAP_CauseMisc_t’ {aka ‘long int’} [-Wformat=]

Change-Id: Icc4e81beaa35e13aea3adfed983016c78b730061
2020-03-20 20:23:04 +01:00
Pau Espin 4ab00db868 tests/hnb-test-ranap.c: Fix wrong printf format
Catched by compiler:
hnb-test-ranap.c:76:44: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘RANAP_CN_DomainIndicator_t’ {aka ‘long int’} [-Wformat=]

Change-Id: Ie4cd6a36fd0e9a871a1815d600e8a321a3d2a208
2020-03-20 20:19:49 +01:00
Martin Hauke c593da5d45 tests: Missing return statement
Change-Id: I4fae9f84a83af280846b07eaa139ff4a05784a2e
2020-02-15 23:01:39 +01:00
Pau Espin 67d32a0386 Bump version: 0.5.0.23-11a1 → 0.6.0
Change-Id: I5f42c0ad1a930004415f097d984e1fd1b2d277e6
2020-01-03 17:04:15 +01:00
Pau Espin d5d3efb546 debian: Split libosmo-sabp from libosmo-ranap package
Related: OS#4342
Change-Id: I936220e95a3334d8052bb2c52fbf335a8a5c3711
2020-01-03 14:46:22 +01:00