aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
AgeCommit message (Collapse)AuthorFilesLines
2018-11-27bsc-nat: Enable octet-aligned when ensuring mode setPau Espin Pedrol2-6/+6
From RFC 4867: octet-align: Permissible values are 0 and 1. If 1, octet-aligned operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed. Change-Id: Ic4db7f6d18f650f36f3186965096771f748de5fd
2018-11-19Fix build with latest libosmocoreMax1-9/+0
Remove locally defined function which conflicts with the one in libosmocore. Change-Id: Ifcc13c4f8998af7680fc17414b2720feee7d386a
2018-10-16mgcp: osmux_send_dummy: Fix return without valuePau Espin Pedrol1-1/+1
Not really critical since only user of this function doesn't check the return value. Fixes commit: 4a2cc9eb0a0f9424c16b26fcb757483a39d67482 Change-Id: I438349bffaa46a10ad8983090a4b17aed7e00d82
2018-10-12osmux.h: Document enum osmux_statePau Espin Pedrol1-4/+4
Change-Id: If5de6e981e9af7b667dd3365d758f868f38bf6e0
2018-10-12mgcp: osmux: Improve checks around activating and using enabled osmuxPau Espin Pedrol1-42/+43
* Refactor code to have unified checks on all paths activating Osmux. * Improve checkings at activation time and add logging. * Code now enforces endp osmux status to be enabled before processing the frame through endp->osmux.out. Before, a delayed or bad pkt could arrive and be processed by an endp with osmux not enabled, using endp->osmux.out that was not initialized and ended up crashing: libosmo-netif/src/osmux.c:281:3: runtime error: member access within null pointer of type 'struct msgb' This could also happen if a BSC started sending or we received (non legacy dummy) osmux frames before we received the BSC CRCX ACK agreeing on osmux negotiation and switching to ACTIVATING state. Related: SYS#4350 Change-Id: I3536169c94e65f999aaa9c9e43cc7dab8551d30f
2018-10-12mgcp: osmux: allow enabling osmux only on correct activating statePau Espin Pedrol1-3/+3
State ACTIVATING is set once negotiation between the 2 parts went successfuly. Change-Id: I21eb30fa8d48f3d592ff197bd74e673fdac51c1d
2018-10-12mgcp: osmux: Make func handling dummy frames independent of endp typePau Espin Pedrol1-3/+3
Change-Id: I285f1cb693b243ecd404337f2bb5b74ddd32b123
2018-10-12mgcp: osmux: Move parse_cid of legacy dummy frames to own functionPau Espin Pedrol1-10/+15
Change-Id: If9249fb0ee2e33c7dd2ab817480776acaa784cc2
2018-10-12mgcp: osmux: Don't process regular osmux frames if disabled by cfgPau Espin Pedrol1-6/+12
Prior to this commit, the check was only done on legacy dummy frames. Change-Id: Ief4e62fe68a11a60d90292c72d1263fd1f728356
2018-10-12mgcp: osmux_send_dummy: Avoid logging incorrectly and sending if osmux not ↵Pau Espin Pedrol1-0/+8
enabled Change-Id: I5244cb9304adef3aa612b8126bf95e77562c801c
2018-10-12nat: Log state of pending transactionPau Espin Pedrol1-2/+2
Change-Id: I9f686404517bf8a2044cf59dd5bfaf90eb4f798f
2018-10-12nat: Log endpoint nr consistently as hexPau Espin Pedrol1-1/+1
Change-Id: I581f40da47614223219800e97a334f8b5e06b13f
2018-10-12mgcp: Log endpoint nr consistently as hexPau Espin Pedrol3-9/+9
Change-Id: I281964935312161d1da49e8035c5bf3bb7bf9c5c
2018-10-12mgcp: Avoid initing output without enabling osmuxPau Espin Pedrol1-4/+4
Otherwise we end up in a weird state where we have timers set up but osmux is still flagged as not enabled. Change-Id: I15c3a1a6bdf2566b03d1d543d8d15e4117a53622
2018-10-04examples: nanobts: openbsc-multitrx.cfg: Set SDCCH in correct TS of TRX1Pau Espin Pedrol1-2/+2
According to verify_chan_comb(), nanoBTS supports SDCCH8 only in TS1. Change-Id: I37b91745ddf7000add3c24f6bb782ae0c61d2978
2018-09-17mgcp_osmux: Use define to calculate rtp_ssrc_winlenPau Espin Pedrol1-2/+2
Since that define is already used to allocate size of osmux_cid_bitmap, let's use it here too instead of hardcoding its value. Change-Id: I768ca1b510bf44508ae064dc31620e739260470b
2018-09-17mgcp: Fix (again) osmux_cid_bitmap static array size calculationPau Espin Pedrol1-2/+2
A previous commit merged today fixed array size boundary (multiple of 8 bits), but removed a required +1 which should be kept on top, because OSMUX_CID_MAX specified the maximum number used by a CID, that is (0,OSMUX_CID_MAX), and as a result we require OSMUX_CID_MAX+1 slots. Fixes: 65f422ad5878165be0a1eb05605aa3099536f0c8 Change-Id: I182c9c1a6dd28a4c5c0d8107d53852cf47541592
2018-09-17bsc_filter: Move whitelisted info log to debugPau Espin Pedrol1-1/+1
It shows up all the time in logs while using "logging level all info", let's move it to debug. Change-Id: I51274dad5afef16e466921c5d58672427d23fd3b
2018-09-17mgcp: Fix osmux_cid_bitmap static array size calculationPau Espin Pedrol1-1/+1
Right now it's not a big issue since OSMUX_CID_MAX is 255, so 255+1 is 256 which fits array boundaries correctly (multiple of 8). However, if for example OSMUC_CID_MAX was modified to be 12, 12+1/8 = 1, so we'd have an undesired memory access when accessing last 4 CIDs. Change-Id: I5908ee44404686e68d61f255b7014af39c8f5703
2018-09-13nat: return -EBADF in read wqueue cb on fd closedPau Espin Pedrol1-1/+1
bsc_msc_lost will close the current fd (without freeing it), so let's skip possible writes to an already closed fd bsc_msc_lost will close the current fd (without freeing it), so let's skip possible writes to an already closed fd.. Change-Id: I55c1a88f6524e897c70abf8ba18f1bb2b1f650aa
2018-09-13nat: Remove misleading commentPau Espin Pedrol1-1/+0
PONG is being sent a as an answer to PING a few lines above in same function. Change-Id: I88ca95d46f4ace1da4025d12302422dbfa578354
2018-09-13nat: Remove misleading commentPau Espin Pedrol1-4/+0
Code is already doing stuff with the connection (fd). Change-Id: Ieeaa0e024b9542d1a22a8e3ab4c3229a6f8a0b49
2018-09-13cosmetic: Remove duplicate semicolon and whitespacePau Espin Pedrol1-2/+2
Change-Id: Ib36b8937d1210488784ebae6917cb1b4c871c9d4
2018-09-13Install sample cfg file to /etc/osmocomPau Espin Pedrol11-12/+30
Change-Id: I080ae6a4c4f92dd8df055efd25e308f8a3377d34
2018-09-13Install systemd services with autotoolsPau Espin Pedrol5-1/+37
Change-Id: I9bc40cf9e9a901d28d1f1629f6f1d55e8ba0c0b6
2018-09-10mgcp_osmux.c: osmux_enable_endpoint: Fix incorrect return checkPau Espin Pedrol1-2/+2
osmux_xfrm_input_open_circuit returns 0 on success and -1 on error. Confusion comes from that function being implemented by calling osmux_batch_add_circuit which returns NULL on error. Change-Id: I98700aa1e2fab9784706bfac1a47cc84635172b7
2018-09-07systemd: describe osmo-bsc-sccplite service as legacyPau Espin Pedrol1-1/+1
Change-Id: I88ba349e547c8f85e12e1ad80a2724086c489c02
2018-08-29Add osmo-bsc-nat systemd service and install it with debianPau Espin Pedrol1-0/+11
Change-Id: I29d719fbe059e38fde97371efc5e562901529b7c
2018-08-28Fix heap-use-after-free due to OML link destructionPau Espin Pedrol4-2/+31
Back-port from osmo-bsc.git 9862bcb5cdb9ece0acfdfb7c81e00c05fcd33ad3. ipaccess_drop_oml was being called inside an osmo_fd cb context, were -EBADF must be returned if the structure holding the osmo_fd is freed. In the middle of the path (see OS#3495 for path tree) it goes through a signal dispatch, so it's impossible to make sure we return some value to the osmo_fd cb. As a result, it is required to defer dropping the OML Link from current code path and do it through a timer. Fixes following ASan report: 20180822124927913 <0004> abis_nm.c:787 OC=RADIO-CARRIER(02) INST=(00,00,ff): CHANGE ADMINISTRATIVE STATE NACK CAUSE=Message cannot be performed 20180822124927913 <0004> osmo_bsc_main.c:186 Got CHANGE ADMINISTRATIVE STATE NACK going to drop the OML links. 20180822124927913 <0015> bts_ipaccess_nanobts.c:406 (bts=0) Dropping OML link. ... ================================================================= ==17607==ERROR: AddressSanitizer: heap-use-after-free on address 0x62e000060a68 at pc 0x7f5ea8e27086 bp 0x7ffde92b6d80 sp 0x7ffde92b6d78 READ of size 8 at 0x62e000060a68 thread T0 #0 0x7f5ea8e27085 in handle_ts1_write input/ipaccess.c:371 #1 0x7f5ea8e27085 in ipaccess_fd_cb input/ipaccess.c:391 #2 0x7f5ea9147ca8 in osmo_fd_disp_fds libosmocore/src/select.c:217 #3 0x7f5ea9147ca8 in osmo_select_main libosmocore/src/select.c:257 #4 0x555813ab79d6 in main osmo-bsc/osmo_bsc_main.c:922 #5 0x7f5ea76d02e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #6 0x555813ab84e9 in _start (/bin/osmo-bsc+0x34d4e9) Fixes: OS#3495 Change-Id: If9e73a3251547625a2372d58f1d8b87210d9f312
2018-08-28abis_nm_ipaccess_rsl_connect: Log bts and trx nrPau Espin Pedrol1-2/+2
Back-port from osmo-bsc.git 24f2f55132f7230e387aef85612dcd6fc59cebe5. Change-Id: I134a3da3700381043bc93aed300ce4ec263e8698
2018-08-28gsm_data.h: Replace '.' in counter names with ':'Pau Espin Pedrol1-39/+39
The '.' is illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Change-Id: I075c0f992e2e31226bd04b9c036ca125467f840e
2018-08-20configure: Find correct libgsm's gsm.h headerPau Espin Pedrol2-0/+11
Some distributions (archlinux) or versions of libgsm install gsm.h in /usr/include/gsm/gsm.h Since libgsm doesn't come with a pkfconfig, let's first check if gsm.h and take the correct path in the build setup. Backport from osmo-mgw.git Change-Id: I07d3c03903e0d4bb80e843c7ed917a27b791ea53
2018-08-20legacy_mgcp: mgcp_test: sanitize: free msgb_ctxNeels Hofmeyr1-1/+4
Ensure that all msgb were cleaned up, then free the overall msgb_ctx, in order to not leave any memory leaks the sanitizer build complains about. Backport from osmo-mgw.git Change-Id: I84e0ac7f0928f04ffddd7da18200466841589c25
2018-08-20Debian: Include the osmo-bsc-mgcp systemd service in Debian packageHarald Welte1-0/+1
Backport from osmo-mgw.git. Change-Id: Ife3f034ddaaba993bf27c1f9a34a1d57d1bf3e05
2018-08-20mgcp_test: tweak test failure outputPau Espin Pedrol1-3/+6
Backport from osmo-mgw.git 020e89bce914d394352dddb8186b65a319562b20. Change-Id: Ibfc80f06b2811cc32fe38518b11efd6764b347ee
2018-08-20mgcp: add VTY Option to force-realloc endpointsPhilipp Maier4-2/+18
Currently the force_realloc feature is turnd on and of in a hardcoded way. This patch makes the option available via VTY. Backport from osmo-mgw.git. Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f
2018-08-20examples: osmo-bsc_mgcp: Update cfg filePau Espin Pedrol1-4/+4
Backport partially (related parts) of osmo-mgw.git a1756f320acb7021c501d56252db133012ad479f ["Implement IuCS (large refactoring and addition)"] Change-Id: I375e67874ccfaadd92d203a911444294d40dfc22
2018-08-20cosmetic: make osmo-python-tests dependency more accurateNeels Hofmeyr1-1/+1
Backport from osmo-mgw.git. Change-Id: I4f84a13b7fa6ec4173bdc155e6114d4d7328b619
2018-08-16vty: Fix typo writing bts-jitter-buffer-delay-{min,max}Pau Espin Pedrol2-4/+4
Change-Id: I83948ce626b924802d1963411a3f40c5fed24355
2018-07-24git-version-gen: Don't check for .git directoryDaniel Willmann1-2/+2
This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: Ibc8c0d8e74bb03bfe87d6f8b9ef6e74c0c889d0f
2018-07-12bsc: ctrl: Avoid sending back received ERROR msgsPau Espin Pedrol1-2/+3
Change-Id: Ib5963e4d15a4a6b077d7a97fbbde6e5134c77e9a
2018-07-12nat: ctrl: Avoid sending back received ERROR msgsPau Espin Pedrol1-7/+11
We only send back if we had an error parsing the message locally. If we receive an ERROR message from a bsc, we try to forward it if the ID is valid, otherwise only log the received error description locally. Related: OS#3394 Change-Id: I7b4d20aea7a16c4b4e5add7c274a4ed34a7f6b8d
2018-07-12nat: ctrl: use strtol instead of atoi as it has explicit error documentationPau Espin Pedrol1-2/+13
In some cases id can be non-digit such as "err" for ERROR cmds generated from parsing failures. Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994
2018-07-12bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed errorPau Espin Pedrol1-10/+2
Instead of always logging/sending same error, use the new ctrl_cmd_parse2 API which always returns a cmd structure with a specific error description. Change-Id: Ie111bec46b664768fe3c3feff906f91e8ee8b1d4
2018-07-12nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed errorPau Espin Pedrol1-11/+2
Instead of always logging/sending same error, use the new ctrl_cmd_parse2 API which always returns a cmd structure with a specific error description. Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae
2018-07-04nat: Add VTY cmd paging-bss-forward to nat nodePau Espin Pedrol3-0/+28
This command controls forward/drop of BSS paging messages from MSC to all BSCs connected to BSC-NAT. In situations in which MS don't generally roam from one BSC to another under the BSC-NAT, it may be beneficial (bandwidth wise) to drop these global paging commands, which are usually issued by the MSC if the location of the MS isn't known and LAC paging has failed. Change-Id: I737774543e0a8734d79b072e66e3c09e82b001d3
2018-06-28bsc-nat: forward paging to all BSC when CELL_IDENT_BSS is receivedPau Espin Pedrol2-14/+34
Previous to this commit, an error message was printed and the paging message was dropped: openbsc/openbsc/src/osmo-bsc_nat/bsc_nat.c:618 Could not parse paging message: -3 Related: OS#3325 Change-Id: I3125ba0e67d2965c0be3089748dd113b1bf615af
2018-06-28bsc-nat: find_paging: Check return code of tlv_parsePau Espin Pedrol1-1/+7
Change-Id: Ib03681cf91550846af0d487c11cc90b6f700b340
2018-06-28filter: vty: Print policy list in cmd show access-listPau Espin Pedrol1-16/+17
Back-port from osmo-bsc.git 653bee7d02a1a1c827b54d235b644fec6a6f4683. Change-Id: Id89febbd84beba8a0c083cbf83649bb4672684c4
2018-06-28bsc_vty: Write access list entries when storing bsc configPau Espin Pedrol4-5/+14
Back-port from osmo-bsc.git d99182c01037f4dd14fb72b2b06497e0c1bebb49. Change-Id: I0b951a9c3dbe245c3813fc91ceb9118a0de779b8