aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-03-09Bump version: 0.8.0.2-fb3a → 0.8.10.8.1pespin/0.8.0Pau Espin Pedrol2-1/+9
Change-Id: I3b2fe0ffe22d9732c03c9fbb751e426161e7fcbb
2020-03-09ortp: disable SO_REUSEADDR + SO_REUSEPORTHarald Welte3-2/+8
ortp >= 0.24.0 doesn't differentiate between SO_REUSEADDR and SO_REUSEPORT, and has both enabled by default. The latter means that we can end up with non-unique port bindings as we will not fail to bind the same port twice. This should have caused visible problems not only when operating multiple osmo-bts on one machine (rare), but also with a single osmo-bts. Once the range (default 16384-17407 ) wraps, there is a risk of new sockets (for new cals) colliding with old ones. As two ports (RTP+RTCP) are used per call, this means every 512 voice calls we expect the BTS to wrap. And from that point onwards there's a risk of overlapping with previously allocated sockets. Change-Id: I4fc9eee561c7958c70c63b4ffdc6cb700b795e28 Closes: OS#4444
2020-03-09Add rtp_test to show the double-bind bug of OS#4444Harald Welte4-2/+109
Change-Id: I6742e5504cfb827031031e4d8d49a616ab203a94
2020-01-02Bump version: 0.7.0.8-4c2c-dirty → 0.8.00.8.0Pau Espin Pedrol3-3/+21
Change-Id: If7099f91a3610d61d16e769406ac27f54e7363f3
2020-01-01input/ipa_keepalive.c: make sure IPA keepalive FSM is registeredVadim Yanitskiy1-1/+1
Change-Id: I36997b31f50fb1e051686a58dac09bc9ed391d17 Fixes: CID#206090
2019-12-01Enable DAHDI support by default; require --disable-dahdi otherwiseHarald Welte4-6/+14
libosmo-abis was built with DAHDI support, if the related header files were present at built time, and without if not. This kind of automagic enabling/disabling of features is wrong. Let's require DAHDI support by default, and force the user to take a conscious decision by using an explicit --disable-dahdi if he doesn't want it. At the same time, update debian/control to list dahdi-source as build dependency. Change-Id: Id9f7f063e7ca9e3ab4aa96fc93f243caf50fb66a Closes: OS#4248
2019-12-02e1_input.c: make reference counting get() / put() more verboseVadim Yanitskiy1-2/+9
Change-Id: I1c730d6d146b365712b28e3d37e038344ea850bc
2019-12-02input/ipaccess.c: fix debug message on receipt of IPAC_MSGT_ID_GETVadim Yanitskiy1-1/+1
Change-Id: I83c52c9733852cfebf183819fb36bd634d84bf7d
2019-12-02input/ipaccess.c: propagate errors from ipa_parse_unitid()Vadim Yanitskiy1-1/+5
Change-Id: Ic190daae31936959de8efb5a6de8744c016d5643
2019-11-14dahdi: Use ioctl(DAHDI_SPECIFY) instead of legacy /dev/dahdi/%uHarald Welte1-26/+35
It appears that opening "/dev/dahdi/channel" and using ioctl(DAHDI_SPECIFY) is possible at least since dahdi 2.4 (from 2010), and opening "/dev/dahdi/%u" has been deprecated ever since. One advantage of the new interface is that you can use channel numbers larger than 250, which is quite easily possible if you have more than eight E1 lines on a system. It also makes libosmo-abis work on systems where there are no udev rules for creating the legacy device nodes. Change-Id: Id6c8f27d7ae948b50e9cf5a38f039d782ff78e1d
2019-11-08ipa: Allow setting local addr and port for struct ipa_client_connPau Espin Pedrol5-8/+41
Change-Id: I3133c6b01647506a5b9c67e4699bcad3ff59f843
2019-09-15ipa: ipa_server_link_close() add checks of link stateAlexander Couzens1-0/+6
When closing a link which failed on open, ipa_server_link_close() would crash it when calling osmo_fd_unregister. Change-Id: I672d4de25464c3829b08aff26b1a6d4ad92e7684
2019-07-21Bump version: 0.6.0.13-b4a7 → 0.7.00.7.0Harald Welte2-2/+32
Change-Id: Ia5ecb2f69ce5436cae8d7a2d300e446ff24e84bc
2019-07-21extend the ipa keepalive fsmEric Wild2-9/+58
The new and improved fsm supports multipe use cases: 1) plain old ipa server/client operation 2) ipa client/server operation with custom send callback (i.e. to bypass the tx queue) 3) all of the above + custom timeout callback 4) fully generic operation that will pass opaque data to the callbacks The current code will always kill the fsm and deallocate it upon timeout, so the timeout callback will now return a value: 1 means the fsm will be automatically terminated, 0 means no action, which allows manually stopping/starting the fsm to reuse it. Change-Id: Ie453fdee8bfd7fc1a3f1ed67ef0331f0abb1d59b
2019-07-21ipaccess.c: Avoid calling close(-1) on error pathHarald Welte1-2/+4
Change-Id: Idabb9805a4a10c95ba0e01bc3f80ed8db87a9f85 Closes: CID#157118
2019-07-17spellingDebian Mobcom Maintainers1-1/+1
=================================================================== Change-Id: I22c98915648760a83abd5f0004af26d426a5e518
2019-07-10contrib/jenkins.sh: run "make maintainer-clean"Oliver Smith1-0/+1
Related: OS#3047 Change-Id: Ib261f25e2c7b48283a6142259991aadfcf40cdec
2019-06-21add TCP_USER_TIMEOUT to keepaliveEric Wild1-0/+11
The patch sets TCP_USER_TIMEOUT to the same timeout value, since keepalive only applies to idle connections, but we obviously want to fail as fast as possible even if there is data to send and it's not acked. Change-Id: I5e7425958472aa5d758e09bfbefc7d7d37bf6f5f
2019-06-21ipaccess: allow tcp keepalive for ipa clientsEric Wild1-2/+4
This allows using the e1_line x keepalive y z setting for clients like osmo-bts. Change-Id: Iadf22934ca6d3c44adac5573709ba53e75fa07da
2019-04-06ipa_keepalive_fsm: Suppress error messages for INIT -> INIT transitionHarald Welte1-1/+1
If we receive an OSMO_IPA_KA_E_STOP in INIT state, we are trying to re-enter INIT, which is not permitted as per the FSM definition. Adding this permission avoids the below error message from hitting the logs every time this happens: <0003> input/ipa_keepalive.c:158 IPA-KEEPALIVE(server)[0x612000000520]{INIT}: transition to state INIT not permitted! Change-Id: I8db2f2e708fc4fbb81f5019973098a80e8f540d2
2019-04-06ipa_keepalive_fsm: Fix OSMO_IPA_KA_E_STOP allstate eventHarald Welte1-0/+1
We had the allstate_action function registered, and that function implemented handling of OSMO_IPA_KA_E_STOP. However, the allstate_event_mask was not set, rendering this functionality inaccessible. Change-Id: I83fd991bdacb7bab794878e47c7797fecf8b9286
2019-03-19Add IPA keep-alive FSM implementationHarald Welte3-0/+327
The IPA keep-alive FSM code takes care of periodically transmitting and IPA CCM PING and expecting an IPA CCM PONG in return. Change-Id: I2763da49a74de85046ac07d53592c89973314ca6
2019-03-19rtp: Add 'autoconnect' feature to the osmo_rtp_socketSylvain Munaut2-0/+23
The bound RTP socket will wait for incoming RTP packets and as soon as it sees one, will 'connect' to it, so all replies will go to that sources and incoming messages from other sources will be discarded. This obviously only works once. Change-Id: I5b54ca4296901fcf37794faf29e0b2acca27bd1b Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2019-03-19tests: use -no-install libtool flag to avoid ./lt-* scriptsOliver Smith1-1/+1
This ensures that the rpath of the generated binaries is set to use only the just-compiled so-files and not any system-wide installed libraries while avoiding the ugly shell script wrapper. Change-Id: Idd458471069ef8912704cc7602c6e8c71c0b62be
2019-03-08ipa: Make ipa_server_conn_destroy() re-entrantHarald Welte1-0/+5
In some situations, the user code called by the closed_cb call-back might be tempted to call itself ipa_server_conn_destroy(), which would lead to a double-llist_del during osmo_fd_unregister() and also a subsequent double talloc_free(). Let's prevent such misuse by existing early in such situations. Change-Id: I0fef264ed5b4218906cdbca243ffa11b891025c6
2019-01-24Log peer's port in accept callbackMax1-2/+2
* log port from which we accept() the connection in addition to address * use macro helper for logging Change-Id: I186974dae1819af8c92f9ea9eeb966ec7c9c9f55
2019-01-24Set local IP in ipa_server_link properlyMax1-1/+10
When creating IPA link for server we might be called without explicit address (which is legit - it means bind to all available addresses). However in this case we won't have 'addr' field of ipa_server_link initialized properly. Fix this by following changes: * don't copy NULL value as address * use socket's local IP when no address set explicitly Change-Id: I33679bb35f426d4cafb223b9200fccbf407e0cf6
2019-01-20Bump version: 0.5.1.20-de57 → 0.6.00.6.0Harald Welte4-6/+38
Change-Id: I417065deb06ac7e8b3b8468b88cc803a41098c2d
2018-12-06log IPA tags correctlyStefan Sperling1-4/+4
Due to apparent copy-paste errors, wrong values were being logged for IPA tags in ipa_bts_id_resp(). Fixes: 4c57eef663e870247cb7a72130a50750317a44b9 Change-Id: I29a0401db0760219b9b9176709a88d589312261b Related: OS#3355
2018-11-12osmo_ortp: Log domain and fix strings without endl charPau Espin Pedrol1-1/+28
Change-Id: Ib6df0df04cd6ba342753c84398274d04917ace40
2018-10-03e1_input.h: Set correct type for input_signal_data->link_typePau Espin Pedrol1-1/+1
link_type field holds values from link->type as set in e1inp_int_snd_event(). Change-Id: Iaa33b793f89f2d16c9d949503c5ecc195bbcd2a4
2018-10-03ipaccess: Simplify handling of ipaccess e1line tsPau Espin Pedrol4-22/+36
Handle encoding specifics behind a macro to make code easier to understand and follow. Change-Id: Ibf251673bff95b7a0b066b19ef4dc6c0f94fff6b
2018-10-02ipacces: Log correct trx_nr during IPA GETPau Espin Pedrol1-1/+1
dev->trx_id points to a structure used for whole BTS and doesn't point to related TRX ID, which is encoded in priv_nr. Change-Id: I00b01790990c8d21fdbe0f5750fa02f13ddb2009
2018-09-20ensure unix socket paths are NUL-terminated for bind/connectStefan Sperling2-7/+15
The unix(7) man page recommends that sun_path is NUL-terminated when struct sockaddr_un is passed to a bind() or connect() call. Non-NUL-terminated paths only need to be dealt with at the receiving end of a UNIX domain socket. Commit b24efa5 erroneously assumed otherwise. Change-Id: I9beecfa500db75cb679b1edcc352c893bf098b13 Fixes: b24efa551dc91e177c5cb8da674e9f8432d52dc9 Related: OS#2673
2018-09-04debian: Conflict libosmoabis6 with libosmoabis5Pau Espin Pedrol1-0/+4
In previous commit 9540f59b1daeac36d71b20ac9cefe15019d6277c, libosmoabis packaging was fixed to match its contained major lib version. However, systems using nightly may run into issues when upgrading since now libosmoabis6 in repo tries to overwrite libosmoabis5 in their system and fails. By using Conflicts + Replaces it should do it now without erroring. Fixes: OS#3365 Change-Id: If98ae21670f13554da5aa46fe30741d56631fd8c
2018-09-04Properly deal with sockaddr_un socket path length limitations.Stefan Sperling2-7/+18
When parsing the configuration, reject a socket path which exceeds the maximum size supported by the operating system. In unixsocket_line_update() stop copying the line's socket path to a local buffer. The path will be copied again in osmo_sock_unix_init(). Both changes are portable; we don't assume any particular socket path length since the size differs between implementations of Unix, and we rely only on information from the generic sys/un.h header. Change-Id: I36344805a825f5d0e0c9d218d438d8fd985ed9ca Related: OS#2673
2018-08-30debian: Fix libosmoabis soname package versionPau Espin Pedrol2-4/+4
LIBVERSION for libosmoabis was increased during v0.4.0 release, but didn't update the debian package name accordingly to match major. Change-Id: I7ead154d72e6dadf795414c47fe276edadd08580 Fixes: OS#3365
2018-08-28ipaccess: Allow passing return code in e1inp_line_ops->sign_link()Pau Espin Pedrol2-3/+3
Change-Id: Ia83eead3622d86f55c1dc5e91acc78dde73a0367
2018-08-28ipaccess: Return -EBADF when closing socket in ipaccess_bts_read_cbPau Espin Pedrol1-7/+2
As we are closing the socket, there's no need for lower layers to continue handling it, so let's return -EBADF. Change-Id: I961b0ef7e598a09ce48a83038c0d90a415e0e11c
2018-08-28ipa: Allow signalling fd destroyed in ipa_server_conn_readPau Espin Pedrol2-7/+9
Similar to what we do in other osmo_fd cb, check for read_cb returning -EBADF and in that case don't attempt using the osmo_fd anymore, either because the fd was already closed (no need to then signal WRITE) or because osmo_fd struct itself has been freed. Change-Id: I4b968b72285f23a9552519cea67398a43d5003d2
2018-08-28ipa: Allow signalling fd destroyed in ipa_client_readPau Espin Pedrol2-7/+9
Similar to what we do in other osmo_fd cb, check for read_cb returning -EBADF and in that case don't attempt using the osmo_fd anymore, either because the fd was already closed (no need to then signal WRITE) or because osmo_fd struct itself has been freed. Change-Id: I0e449a2bdf7f0411feeccd262cd731ca6fba3fc1
2018-08-28ipa: Simplify code in ipa_server_conn_readPau Espin Pedrol1-6/+4
By doing this change we remove a duplicated error code path and thus avoid having to maintain an extra code path with function pointers. Change-Id: I5bce9f92209cc2fb37b78792e34f7898c71d2327
2018-08-28ipa: Simplify code in ipa_client_readPau Espin Pedrol1-8/+4
By doing this change we remove a duplicated error code path and thus avoid having to maintain an extra code path with function pointers. Change-Id: Ic044894980ae2b882d99eb30d9df50066671d8f3
2018-08-24ipa: don't crash on missing IPA ID GET messageNeels Hofmeyr1-4/+8
ipaccess_bts_read_cb() only initializes signalling links if it has received an IPA ID GET message on it, and so far happily accesses the uninitialized sign_links list anyway if it hasn't. Reproduce: simply don't send an IPA ID GET message when connecting to an IPA server run by libosmo-abis, then continue to use the link --> segfault. Fix the segfault: make sure that the e1inp_ts' type has been set, i.e. that e1inp_ts_config_sign() has been called and the sign_links llist is initialized, before calling e1inp_lookup_sign_link() on it. ../../../src/libosmo-abis/src/e1_input.c:511:2: runtime error: member access within null pointer of type 'struct e1inp_sign_link' ../../../src/libosmo-abis/src/e1_input.c:512:11: runtime error: member access within null pointer of type 'struct e1inp_sign_link' ASAN:SIGSEGV ================================================================= ==5702==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000038 (pc 0x7f28a379ea34 sp 0x7ffd7d8933f0 bp 0x62e000000a98 T0) #0 0x7f28a379ea33 in e1inp_lookup_sign_link ../../../src/libosmo-abis/src/e1_input.c:512 #1 0x7f28a37b97d4 in ipaccess_bts_read_cb ../../../src/libosmo-abis/src/input/ipaccess.c:778 #2 0x7f28a37b0277 in ipa_client_read ../../../src/libosmo-abis/src/input/ipa.c:76 #3 0x7f28a37b0277 in ipa_client_fd_cb ../../../src/libosmo-abis/src/input/ipa.c:139 #4 0x7f28a2ac1a34 in osmo_fd_disp_fds ../../../src/libosmocore/src/select.c:217 #5 0x7f28a2ac1a34 in osmo_select_main ../../../src/libosmocore/src/select.c:257 #6 0x444ba3 in bts_main ../../../../src/osmo-bts/src/common/main.c:364 #7 0x7f28a17ddb44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44) #8 0x405e54 (/usr/local/bin/osmo-bts-trx+0x405e54) Related: OS#3498 Change-Id: I2487ca37a0fe9aa56733f66bcad9dcf91fc11144
2018-08-23ipaccess_rcvmsg: Fix bug introduced in previous commitPau Espin Pedrol1-1/+1
Commit 56ae85fd524d5c9e8b61ccb19e81b16fbc726bb0 modified code in ipaccess_rcvmsg to use osmo_fd_setup. During this change, a "|=" operator was converted to "=". Fix this change by manually ORing old and new values passed to osmo_fd_setup. Change-Id: Ie59072f07ca50d853c413fa038e447dcdee30a76
2018-08-22ipaccess: Use osmo_fd_setup to set up callbacksPau Espin Pedrol1-15/+5
We have a public API in libosmocore, so let's use it istead of manually filling each struct field. Change-Id: I09479c3d5b0b9bd69a56c080b8c533a32824cc66
2018-08-06debian/rules: Don't overwrite .tarball-versionHarald Welte1-5/+1
The .tarball-version file should contain the *source version* uniquely identifying the git commit, and not the Debian package name. With https://gerrit.osmocom.org/#/c/osmo-ci/+/10343/ there is a correct .tarball-version file in the .tar.xz of the nightly source packages. Change-Id: I4ce87d474687b61bc2104a02015e954425736123 Related: OS#3449
2018-08-01Migrate from ipa_ccm_idtag_parse to ipa_ccm_id_resp_parse()Harald Welte2-4/+2
In libosmocore Change-ID I1834d90fbcdbfcb05f5b8cfe39bfe9543737ef8f we have introduced ipa_ccm_id_resp_parse() as a bugfixed replacement of ipa_ccm_idtag_parse(). The main difference is that the returned "value" parts now have a correct reported "length", whereas before this commit they all reported a one-byte too-long "length" for each IE. Change-Id: Id4c9ff821a43a37cbacce905d44fee43d1b2c879
2018-07-27fix strncpy bugs in ipaccess.c, ipa_proxy.cNeels Hofmeyr2-8/+6
Change-Id: Iad53b603521c0a8f4857bd87dca777ba8e875cde
2018-07-27Bump version: 0.5.0.10-a210-dirty → 0.5.10.5.1Pau Espin Pedrol3-5/+25
Change-Id: I9a606d5d3f9ce6baf99e69d60529332a460a9504