Commit Graph

6695 Commits (master)

Author SHA1 Message Date
Pau Espin 20f9067b49 Bump version: → 0.4.1
Change-Id: Ie3312574419e982bdd52174411393c9088c3a036
2023-09-12 17:02:13 +02:00
Oliver Smith c44b50c147 gbprox_rx_ptp_from_bss: fix dangling pointer
Building with gcc (Debian 12.2.0-14) 12.2.0 and --enable-werror fails
without this during "make distcheck":

../../../src/gb_proxy.c:450:24: error: storing the address of local variable 'tp' in '((struct libgb_msgb_cb *)msg)[2].bssgp_cell_id' [-Werror=dangling-pointer=]
  450 |         msgb_bcid(msg) = (void *)&tp;

This means that gcc now warns (and we turn that into an error) if one
assigns the address of a local (stack) variable to something allocated
on the heap, and doesn't remove that reference before ending the function
(invalidating the stack).

Related: OS#6057
Change-Id: Ie51e37572993cb5dc24ecf13bc300225f09cb744
2023-07-17 07:06:44 +00:00
Oliver Smith 7724fb717b systemd: depend on
Related: SYS#6400
Change-Id: I29e547242b2ed1cfc4750c7d7e5f8636c2e8f3dc
2023-05-26 14:10:45 +02:00
Oliver Smith 5788f73ee8 debian: set compat level to 10
Related: OS#5958
Change-Id: I4b2988fffba12cc84ff0834bb9ef0f3d9de2bcda
2023-04-25 16:48:21 +02:00
Vadim Yanitskiy d1f6a8723d tests: do not depend on $(BUILT_SOURCES), but on osmo-gbproxy
$(BUILT_SOURCES) is not defined, makes no sense to depend on it.

Change-Id: Iefb7ae1a660891a556cf6bf2e46e1d4440da1683
2023-03-30 03:13:56 +07:00
Pau Espin ddbe35dcb4 Bump version: → 0.4.0
Change-Id: I016f48591f7bd69662bc45aa2c7e8fc3dddb4feb
2023-02-07 17:37:14 +01:00
Alexander Rehbein c82f0fb2a1 osmo-gbproxy: Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: Ib76ab5df5d87112bf78effc4cd0939c57f30f46c
2022-12-23 11:13:38 +00:00
Max 6a448976a8 ctrl: take both address and port from vty config
Change-Id: I9bb88fa53a91cc96440d83958450729fa433a04b
2022-12-17 21:20:10 +03:00
Harald Welte 954ce62635 manual: Use combined/merged gb-ns2 chapter

Depends: osmo-gsm-manuals I3c618e5af61b376435f400ef9c64245cec2f9b73
Change-Id: I881d8c2d400e47d9a39f8bd93668e1c3299e292f
2022-11-28 17:49:22 +01:00
Daniel Willmann 9a3fe3c860 Fix obsolete documentation of function
Change-Id: I9588b237f1ee2979fe4ac7c802f1ff6300573e0a
2022-10-20 15:50:12 +02:00
Daniel Willmann 33dcdad449 Improve log levels
* Set log levels to LOGL_NOTICE by default
* Set log message about pooling being disabled to debug

Change-Id: Ieddf20a5eafaa9738d5d1e9a9aae320e48aa2efc
2022-10-20 15:50:12 +02:00
Daniel Willmann 39a9d0ccf3 gbproxy_vty: Add commands to list Cell/BVC of an NSE
Change-Id: I10c6d3f59681ec6dc98f1a3b023af446cc2a1c12
2022-10-20 15:50:12 +02:00
Max e3b991268b Drop forward declaration of gbprox_relay2peer()
There're no calls to the function before actual declaration so
forward declaration serves no purpose, just pollutes 'git grep' results.

Change-Id: Id8bce05ef347df93202a77b817a10903acaa9d97
2022-10-13 17:13:21 +03:00
Alexander Couzens 96a4427108 implement LL DISCARD with second BVCI
Needs TTCN3 tests

Depends: libosmocore I76dc3b08a63cfd78c9f7657fb58c2ddfa9b4b7e2
Change-Id: Iaa488ee8ac3d85b86c0f360d9d6440f7cda82230
2022-09-28 16:56:33 +02:00
Max 81816139fd Set working directory in systemd service file
By default systemd will execute service with root directory (or home directory for user instance) which might result in
attempts to create files in unexpected place. Let's set it to 'osmocom' subdir of state directory (/var/lib for system instance) instead.

Related: OS#4821
Change-Id: I5117ab8d7b8542a161f69a9784a9667bda599473
2022-08-30 20:05:35 +07:00
Vadim Yanitskiy 492468d772 do not require unused dlsym/dlopen
Change-Id: Ib1a208c40ba9c3667980e5c404087e801a4eaaf1
2022-08-16 23:46:29 +07:00
Pau Espin 6e1b300742 Bump version: → 0.3.0
Change-Id: I23c62ffbff6e3ef432adf6f8b3003f290a959889
2022-06-29 11:54:09 +02:00
Harald Welte 3cc70e6f0b update git URLs (git -> https; gitea)
Change-Id: I56d19d28078c6e8a381dc155ca1001d39621ef1d
2022-06-20 10:41:12 +00:00
Alexander Couzens 3ca5730bf6 docs: usermanual: add new chapter gb-ns2-maintenance
Depends-On: I5571001a127c933397a4bc26e85410288d50fc2f (osmo-gsm-manuals.git)
Change-Id: I951cc10d86de4f16d2226b34eda55202373c2524
2022-04-04 12:20:35 +00:00
Daniel Willmann 2f30a0c58c gbproxy: Ensure PtP-BVCs are reset when we reset the SGSN SIG-BVC
Related: SYS#5908
Depends-on: If240dd13f0f674693018c93390386b2c8afb97af (libosmocore.git)
Change-Id: I6560d8ce1ee6a0d7d42d625b76f6dd637dedb6c0
2022-03-30 16:40:29 +02:00
Alexander Couzens f567c1f395 docs: usermanual: reorder gb/ns2 chapter to keep all ns2 part together
Change-Id: I3bc1c4de090a073cf1b1a6fe852f17857754beaf
2022-03-04 17:40:58 +00:00
Daniel Willmann d71aa6bf20 gbproxy_peer: Add rate counters when forwarding packets fail
Change-Id: I7fa972ba843993dac84241c04d66d5b7e2a0b40f
2022-03-03 18:15:24 +00:00
Daniel Willmann f87255ab80 gbproxy_peer: Use designated initializers for bvc_ctr_description
Change-Id: If571e5d5b653291f34df516b801f35225dd4f7c9
2022-03-03 18:15:24 +00:00
Daniel Willmann 5ceeb2b321 gbproxy: Only route to an SGSN if the BVC is not blocked
Change-Id: I0b54813c04bae2c63975082ad2dacae8affd3127
2022-03-03 18:15:24 +00:00
Pau Espin 0531fab8a2 Drop unneeded ax_check_compile_flag.m4
The macro is no longer used since

Change-Id: Idaae48ef5913819eb468fe87cca7c8b99288765f
2022-01-11 18:19:54 +01:00
Daniel Willmann 28ec0e33fc gbproxy_peer: Free all related BVCs if the cell is freed
Previously the SGSN BVCs would still be present after the related Cell
was freed. This caused some inconsistencies if a BVC with the same BVCI
was established again. The symptoms of this were cells that were attached
to no SGSN or the same one multiple times and crashes.

This patch ensures that the SGSN-side BVCs are also freed when the cell
is freed and that this fact is reflected when handling reset

Change-Id: Iedeede8917e2870e0b62a2050ccb331109167017
2021-12-06 16:55:47 +01:00
Daniel Willmann e705b3fb3f gbproxy: Fix crash when FLUSH_LL_ACK does not contain a BVCI IE
The BVCI IE is listed as conditional and is only included if the flush
action indicates that LLC-PDUs are transferred. (3GPP TS 48.018 Ch.

The code in gbprox_rx_sig_from_bss unconditionally tries to get a BVCI
from a FLUSH_LL message which could result in a segfault if no such IE
is included. Routing towards the SGSN can happen simply based on TLLI (for pooling)
since there is only one signalling BVC towards the SGSN.

Related: OS#5332
Change-Id: I659f9c925bb38b8cf2348b84b976142d8d4693f7
2021-11-25 22:04:56 +01:00
Daniel Willmann af2e9b349c gbproxy: Also try to route STATUS messages with truncated PDU in error
Related: OS#4892
Change-Id: I173eb8ef6257248e3c893c31486575019a3ef873
2021-11-18 16:18:00 +01:00
Daniel Willmann f689a8a007 gbproxy: Fix error return value
OSMO_TLVP_ERR_MAND_IE_MISSING is already negative

Change-Id: I17e438be50324684cebe0852ecab877097bb0cbb
2021-11-18 15:27:37 +01:00
Pau Espin d23ebf5357 Bump version: → 0.2.0
Change-Id: I42647a35746c3cbd89e88d9f90f22f1c9275a919
2021-11-16 18:03:02 +01:00
Daniel Willmann f9902c5c05 gbproxy: Remove duplicate struct gprs_ra_id handling
The ra_id as well as the cell_id are already present in struct
gbproxy_cell which is reachable from bvc->cell. Remove the ra_id in
struct gbproxy_bvc and also remove some unused/unneeded code. The FSM
reset_notif callback already takes care of updating the cell.

Related: OS#4894
Change-Id: Ibc9f42a60706612c17e5f8f0468c7faced5ae4c8
2021-11-12 16:32:28 +01:00
Oliver Smith 2705fdc908 Revert "Turn some compiler warnings into errors"
Do not turn some compiler warnings into errors by default. This patch
was added before --enable-werror was available.

We build with --enable-werror during development and in CI. If the code
is built with a different compiler that throws additional warnings, it
should not stop the build.

This reverts commit 34f012639ddf41470714ae74ae961d158670a4c7.

Related: OS#5289
Change-Id: I2fb777410ffc181feabd6aee3beda3ed05ba5c90
2021-11-04 11:02:57 +01:00
Daniel Willmann 0141628144 gbproxy: Only use one struct tlv_parsed for gbproxy_decode_bssgp
Change-Id: I7965a4b68866c619159c524a63e051b0d9cbe80f
2021-11-02 14:51:18 +01:00
Daniel Willmann cfb6f17f51 gbproxy: Increase correct counter when BSSGP decode from SGSN fails
Change-Id: I8936cee105c933987c9af1fac3c91dc26864325b
2021-11-02 14:51:18 +01:00
Daniel Willmann 22311804e9 gbproxy: Move BSSGP decoding into its own function and use it
This code was copied in BSS and SGSN PTP receive functions and also in
the functions that extract the inner PDU-in-error from the STATUS PDU.

Use a central function for less code duplication and better

This also fixes TTCN3 test TC_status_ptp_ul_tlli the c&p omitted the
special handling of UL/DL unitdata.

Related: OS#4892
Change-Id: I882aa97b0f4158affe45e81e4e4701bd36ef89f7
2021-11-02 14:51:18 +01:00
Daniel Willmann 5a14837753 gbproxy: Route STATUS in PtP-BVC by TLLI/TMSI as well
Related: SYS#5235, OS#4892
Change-Id: Ib31c60ba840522719f307df089efeb8f4da1d9ae
2021-10-29 18:28:13 +02:00
Daniel Willmann 6ec5f95748 gbproxy: Add comment, remove unused param in gbproxy_tlli_from_status_pdu
Change-Id: I8fc4c42c11ee38df80fbd316bbe6b1eb243b5323
2021-10-28 16:17:36 +02:00
Daniel Willmann 3d8f599fd1 gbproxy: Route DL STATUS with BVCI on SIG-BVC
Fixes TTCN3 gbproxy test TC_status_sig_dl_bvci

Related: OS#4892
Change-Id: I5928cebea7f39d6648f95dfa1a46437de202f723
2021-10-28 16:17:36 +02:00
Daniel Willmann 885f430965 gbproxy: Improve STATUS handling from SGSN
STATUS with cause bvci blocked or unknown should not be forwarded

Related: OS#4892
Change-Id: I0ab88634fe2eab5299ff4587fcef4177ce5b4831
2021-09-30 16:59:50 +02:00
Daniel Willmann c5dcebdf42 gbproxy: Add comment, improve log message in gbproxy_tlli_from_status_pdu
Change-Id: Idcd2742f451ba5ae79f62395e033924782336cac
2021-09-30 16:57:51 +02:00
Daniel Willmann cbfc7cf0e2 gpproxy: Route BSSGP STATUS with PDU_IN_ERROR containing a TMSI
Derive a foreign TLLI from a TMSI and route the message according to it
Fixes TC_status_sig_ul_tmsi

Related: OS#4892
Change-Id: Iebda9e9fd433cd28c0f657adc4d475d4e6e247ba
2021-09-30 10:30:56 +02:00
Daniel Willmann 7d37cbb605 gbproxy: Route BSSGP STATUS with PDU_IN_ERROR containing a TLLI
Fixes TC_status_sig_ul_tlli

Related: OS#4892
Change-Id: I9d2ec73520ee46ceedda3f7e63035e6a51a65ac2
2021-09-30 10:30:42 +02:00
Daniel Willmann 723bb36829 gbproxy: Improve log message when no bvc is found (include bvci)
Change-Id: I0cb05b2069d7ef86ed0f7921044aaad01121a412
2021-09-29 17:14:35 +00:00
Daniel Willmann 99a46ff383 gbproxy: Use designated initializers for global_ctr_description
This already showed one unused description where only the enum had been removed.

Change-Id: Ifdb822c25236c19dd52a3ea1370c466d66f9d11d
2021-09-29 13:55:41 +00:00
Daniel Willmann c4b913ba5b gbproxy: Fix stats when no BVC could be found
Change-Id: I413b500515b6c4266370b29943b14447b38a66a0
2021-09-29 11:35:06 +02:00
Daniel Willmann dc763fdf39 gbproxy: Avoid sending STATUS on unexpected BLOCK_ACK
Handle SGSN BVCs that are gone from the BSS differently.

The previous patch removed the gbproxy_bvc on the SGSN-side after it was
gone on the BSS-side. This caused a STATUS response to BVC_BLOCK_ACK messages
that should be valid. Instead of removing the BVC this patch marks it as
inactive so we can still handle BVC_BLOCK_ACK correctly, but ignore
other messages - especially BVC_RESET from the SGSN.

Related: SYS#5628. OS#5236
Change-Id: Ic9f34a27412d6e15ca1198ee140f66a076b5c6b6
2021-09-29 11:35:06 +02:00
Daniel Willmann a1304ee8ef gbproxy: Remove SGSN-side BVC after sending BVC-BLOCK
If we keep the bvc around the SGSN could send a BVC-RESET which the
gbproxy would ACK. This will reestablish the BVC only between the gbproxy and
SGSN which can lead to all sorts of issues.

With this patch the gbproxy will respond with a BVC-STATUS cause BVCI

Related: SYS#5628
Fixes: OS#5236
Change-Id: Ib14be6425a81b43353708b2708f79e035e501079
2021-09-24 15:54:10 +02:00
Oliver Smith 00eddca5d2 debian/control: remove dh-systemd build-depend
Related: OS#5223
Change-Id: Ieb8669a9a43ea1acc6b2d8d2e363f2466c51697a
2021-09-01 16:07:06 +02:00
Daniel Willmann 5f762597e5 gbproxy_ctrl: Ignore SIG-BVCI in ctrl commands
Both ctrl commands gbproxy-state and number-of-peers should only
operate on PtP-BVCs. This patch avoids a crash in gbproxy-state and
fixes the count of number-of-peers to only include PtP-BVCs.

Related: SYS#5542, OS#5200
Change-Id: Ida5f9ad0a16b991e77eec0e3cdb779dcfa472fab
2021-07-19 16:10:36 +02:00
Daniel Willmann 5e8c0e813c gbproxy_ctrl: Fix crash in nsvc-state ctrl command
ctrl_nsvc_state_cb() expects us to pass a struct nsvc_cb_data so do that
instead of passing only the ctrl_cmd.

Related: OS#5200, SYS#5542
Change-Id: I8bc67cc9bc90dab9cfca30b062d1d78897aa1e51
2021-07-19 16:05:59 +02:00