6813 Commits

Author SHA1 Message Date
Pau Espin Pedrol
61d3e3a377 gsm48_gmm_ie_tlvdef: Add newer definitions from current enum gsm48_gprs_ie_mm
Depends: libosmocore.git a28ae056435b0de575441f7608101117d1beda0c
Change-Id: I38dc87bcaa23a5c4ec36ae4ab082b150dad93840
2024-11-19 19:30:01 +01:00
Pau Espin Pedrol
d4bded987b gsm48_gmm_ie_tlvdef: Add missing definitions from current enum gsm48_gprs_ie_mm
Fill in defintions for all enum fields defined as of libosmocore.git
51bbb34a16359941f17a0b80d8fe9b6d73d12307.

Change-Id: I2648fbfb0f133069470a829d80fdbe80b7e6e1ef
2024-11-19 18:59:19 +01:00
Pau Espin Pedrol
99bc975225 gsm48_gmm_ie_tlvdef: Sort based on enum gsm48_gprs_ie_mm order
Change-Id: Icb943e06b7ee7bd7f2def30c9b5ec5d24123cd94
2024-11-19 18:56:48 +01:00
Alexander Couzens
7138f8eb93 Use %d instead of %i
%d and %i has the same meaning when used in format string for printf.
The linter will warn when using %i. %i was only added to provide
symmetry between scanf() and printf().

Change-Id: Icd5f5f9b0d2ed8fd82afa406787acb4bd95358bf
2024-10-22 10:25:51 +02:00
Alexander Couzens
5b289e83cf GMM: split parsing of a RA Update Request in a separate file
gprs_gmm.c is huge. Further split the general validation
and parsing of the message into an own function.

Change-Id: I413da1b6b4b7c0c4781393acd8564661bc74ce2d
2024-10-22 10:25:51 +02:00
Alexander Couzens
8a2ed97336 move gsm48_gmm_att_tlvdef into gprs_gmm_util
The gprs_gmm.c is huge. Move message parsing into gprs_gmm_util.c.

Change-Id: I67dcdb986fd01dc093501d324b5c376246a5d30d
2024-10-22 10:25:49 +02:00
Alexander Couzens
72283a1686 Refactor diffing same GMM messages
gprs_gmm_attach_req_ies() isn't specific for the attach request.
It also did not cover the full message because of a fixed message length
when comparing both messages.

A diff of the old and new GMM message is required to figure out
if the MS/UE is retransmitting an old message or starting
a new procedure.

Change-Id: Ie698d3a6894a5796663c22c8bfd12b47acda57e6
2024-10-21 20:53:52 +02:00
Alexander Couzens
e7303adc8d Implement correct Routing Area based paging
Previous the SGSN would not support multiple BSS within the
same routing area.
Add support paging of a whole routing area.

Change-Id: I181da9f656e394ccfcb8999021a5b7e13ca0419f
2024-10-21 20:53:52 +02:00
Alexander Couzens
e8c82d9cd1 Add Routing Areas
Add a routing area layer which tracks routing area and
cells within a routing area.

Change-Id: I2474b19a7471a1dea3c863ddf8372b16180211aa
2024-10-21 20:53:52 +02:00
Pau Espin Pedrol
6213201b95 ranap: Reject ActivatePDPCtx from UE if RABAssResp parsing fails
Before this patch, if Rx path at RAB Ass Req failed, the PDP ctx in the
middle of being activated was left untouched.
Explicitly communicate the failure to both sides (UE and GGSN).

Related: OS#6508
Related: SYS#7119
Change-Id: I111cc4b17100d2e1ef756b654dc9e98415b3a8bb
2024-10-16 17:22:35 +02:00
Pau Espin Pedrol
3087322c3e ranap: Fix decoding of padded ITU X.213 IPv4 TLA in Rab Ass Resp
Simply use the existing omos-iuh library helper to decode the IP
address, which is more robust than existing adhoc code in osmo-sgsn.
The library version already supports decoding ITU X.213 IANA binary IPv4
addresses padded to 20 bytes.

Related: OS#6508
Related: SYS#7119
Change-Id: I9c48b676068574338f60b6ed7ad8b61ba748b52e
2024-10-16 17:22:09 +02:00
Oliver Smith
b12c892a42 contrib/jenkins: libosmo-sccp -> libosmo-sigtran
Change-Id: Id587ed1a8604c4881fd82784ad400c91d9125e32
2024-09-16 12:29:43 +02:00
Oliver Smith
a39a564906 debian/control: remove build-dep: libosmo-sccp-dev
This follows the removal of the libsccp.a and the pkg-config
libosmo-sccp.pc from libosmo-sccp.git

Related: libosmo-sccp I299a32a2f8f61477cf49c8126567fef2092d5407
Change-Id: I2fc827cf15b7f78173e5ee489abe2c6d12b82c2f
2024-09-10 09:54:58 +02:00
Vadim Yanitskiy
13592d2fa5 sm: pdpctx_timer_stop(): warn about timer not running
Similarly to 282de031, this commit turns errors like:

  DGPRS ERROR PDP(---/0) Stopping PDP timer 3395 but 0 is running

into warnings with a more accurate reason:

  DGPRS ERROR PDP(---/0) Stopping *inactive* PDP timer 3395

Change-Id: I64932d1cbd93667ab2e94e04691d6601435dba81
Related: 282de031 "gmm: mmctx_timer_stop(): warn about timer not running"
2024-08-30 05:21:41 +00:00
Alexander Couzens
12ed86d17a Replace gprs_ra_id with modern osmo_routing_area_id
The new modern osmo_routing_area_id is more flexible
and allow to access PLMN, LAC more convient.

Depends: Iaef54cac541913534af00f40483723e9952a6807 (libosmocore)
Change-Id: Ia41eb8f51d3836b1bc65325ff1ec6bdb16e20c7e
2024-08-20 14:08:14 +02:00
Pau Espin Pedrol
35c178e84d llc: Mark old/current tlli as all 1's when unassigning LLME
TS 44.064 section 8.3.3 (and other sections) talk about special
unassigned value of "all 1's", but I couldn't find any reference to a
"all 0's" specific value/meaning.
In practice in the code this may not be super important since those
values may not ve checked due to the FSM state, but in any case they are
initially set to all 1's, so it makes total sense to re-set them to the
same unassigned value instead of a randomly chosen all 0's value.

Change-Id: I660c8d0ef08b34f8cb74fd51b5c59e5628d687ae
2024-08-19 18:26:31 +02:00
Pau Espin Pedrol
868d818e6e Fix double free during RAU with unexpected Old RAI
If an MS which had an MMCTX at the SGSN sent RAU update with an
unexpected Old RA field, the RAU was rejected and LLME (LLC layer)
unassigned (freed), because no MMCTX was found matching the wrong old
RA.
However, an MMCTX may actually exist pointing to that LLME, and hence
when the LLME is freed, it stayed unnoticed with a dangling pointer to
the freed LLME in ctx->gb.llme.
Let's try to harder to avoid this kind of bugs which make osmo-sgsn
crash.

Once we properly split the code into separate independent layers (LLC,
MMCTX, etc.) each holding their own structs, this kind of bugs shouldn't
happen anymore.

Related: OS#6441
Change-Id: I5a4328c6e945b85dd815215724feecadba59c435
2024-08-19 18:20:53 +02:00
Vadim Yanitskiy
140017e0ed build: do not link against libosmo-abis
We use 'struct ipa_client_conn' from libosmo-abis:

  src/sgsn/sgsn_vty.c:56:#include <osmocom/abis/ipa.h>

but do not call any of its API directly, so linking against it
is not necessary.  Remove it from $LDADD, but keep in $CFLAGS.

Change-Id: I11168a7b25942d6c70566441fb0a1d26c3ae5c43
Related: OS#6535
2024-08-09 17:57:31 +07:00
Vadim Yanitskiy
c239545936 build: remove indirect libosmo-netif dependency
Neither we include its headers nor call any of its functions.
It's actually a dependency of libosmo-sccp, which is required
for '--enable-iu', so keep it in contrib/jenkins.sh.

Change-Id: Ia3395fd335d3a693c314b29b8e92968eef55da9a
Related: OS#6535
2024-08-09 17:57:22 +07:00
Alexander Couzens
9650961c4b includes: add forward declartion of external types
Change-Id: Ifbf0a045a6391694155f6627967f2d92b930d765
2024-08-04 19:52:35 +02:00
Alexander Couzens
c05dad1035 includes: sgsn.h: use full path include for gtp.h
The gtp header of ggsn have been moved to osmocom/gtp/gtp.h for a while.
Use the full path to prevent clashs with older versions

Change-Id: I764644110c0f332b18117e1e8311ddc55eafd5fa
2024-08-04 17:44:37 +02:00
Pau Espin Pedrol
7d5337fe80 Handle rx UpdatePDPCtxReq with Tunnel Direct Flags EI=1
GGSN informed us that it received an Error Indication when sending DL data to the RNC.
This probably means the RNC lost its state, aka crashed or was rebooted.
Mark the subscriber as PMM-IDLE, release Iu and point GTPU back to SGSN.
Then page the UE so it hopefully re-creates the state at the RNC.

Related: OS#6512
Related: OS#6519
Related: SYS#5435
Depends: osmo-ggsn.git Change-Id Ic80a9a928c55b6ff85be96014920bb42793cb943
Change-Id: I76d4c387730fdbfb9e7e0dd23a5afb9e762228b1
2024-08-01 11:39:00 +02:00
Pau Espin Pedrol
2cd06e28f4 Announce SGSN own TEID during UpdatePDPCtxReq after UE goes PMM-IDLE
When the UE/RNC closes the Iu conn (while keeping the PDP Context
activated), the SGSN updates the GGSN to point the GTPU tunnel to
itself. Unfortunately, only the IP address was being updated while the
TEID was kept the same (the one from the RNC).

As a result, when new MT data arrived at the GGSN, it would forward it
over GTPU to the SGSN using the incorrect RNC TEID, which the libgtp
stack at osmo-sgsn would silently drop due to not being known (because
it was >PDP_MAX=1024).

The issue can be triggered in test SGSN_Tests_Iu.TC_pmm_idle_rx_mt_data.

Related: OS#5773
Related: SYS#5435
Change-Id: I782aa43c71569922a945bd44544bb1388bf8c878
2024-07-30 21:38:41 +02:00
Pau Espin Pedrol
0bab0007c7 gtp: Set Direct Tunnel Flags DTI during UpdatePDPCtx
This is required as per TS 28.060 to tell the GGSN that the remote
Address/TEID it is receiving it's the one of the RNC.
Upon receiving a GTPU Error Indication, the GGSN knowing it's using
DirectTunnel, can then update the SGSN with UpdatePDPContextReq with
Direct Tunnel Flags DTI=1 EI=1 and then the SGSN can decide whether
reconfigure the Direct Tunnel or switch to 2-leg tunnel until the
connection with RNC/UE can be reestablished.

Depends: osmo-ggsn.git Change-Id Ia3e360a35d30858eab1e438dc2508fd756c2e22e
Related: SYS#5435
Change-Id: Iefe73eeea41df0c55db673194c9e9547504cbf0d
2024-07-30 21:38:37 +02:00
Pau Espin Pedrol
4ced617eb6 Fix DeactPDPCtxAcc when UE goes PMM ENABLED but lost its PDP context
Scenario: UE activates a PDP context, then after a while goes PMM IDLE
(Iu conn is destroyed but PDP is kept).
When UE connects through Iu again, it sends eg. RAU or ServiceRequest
with pdp_status bitmask statis the active NSAPIs.
If some NSAPI (PDP context) is enabled at SGSN but doesn't show up in
the bitmask, SGSN will destroy the PDP context with GGSN
(DeletePDPContextReq) towards GGSN prior to re-creating it.
When SGSN receives the DeletePDPContextResp, it would forward a
DeactivatePDPContextReq to the UE for a PDP context which was not known
by the UE anymore, this is wrong.

With this patch, the state of the NSAPI/PDP at the UE side is tracked,
and used to know whether when the PDP gets deleted on the GGSN side then
it needs to also be deleted on the Iu side.

Change-Id: I0ccd9228d71c29248b5f510356dbfdb09565dc30
2024-07-30 21:36:01 +02:00
Oliver Smith
f8d248e2d1 Bump version: 1.11.1.22-bea6a-dirty → 1.12.0
Change-Id: I9331fb5c69c5d00d419e859f1fa81d6e231b0318
1.12.0
2024-07-24 17:31:38 +02:00
Vadim Yanitskiy
bea6a0ffb5 README.md: cosmetic: fix a typo
Change-Id: Ia23fdbde29691c7af3834effee3d03ab866ca809
2024-06-05 18:34:07 +07:00
Oliver Smith
a13cc20c98 doc: set state-dir to /var/lib/osmocom/osmo-sgsn
Be consistent with osmo-ggsn, and set the state dir to
/var/lib/osmocom/osmo-sgsn. Without this patch, it defaults to the
current directory, which means in case of running with the systemd
service, /var/lib/osmocom.

Copy osmo-sgsn.cfg and osmo-sgsn-accept-all.cfg to the tests dir and do
not set the state-dir there. Usually the user that runs the VTY and CTRL
tests is not allowed to write to /var/lib/osmocom. (I've also tried
generating these on the fly, but that breaks in 'make distcheck', as I
would need to write to the source dir or would need to change
osmo-python-tests etc. to read the config file from another directory.)

Related: osmo-ggsn I5b51529b4f8bd2462e54f58a1ce2e2d7c76ff46a
Depends: osmo-python-tests Ic312d546da1c21f68a80b6a188616ef9bc84f4c6
Change-Id: I309807ff0bc125d4653222b2b4ba69ded3bbff70
2024-05-27 14:36:01 +02:00
Oliver Smith
1fd4a4c135 debian/osmo-gtphub.init: delete
Remove SysV init scripts. These are not really maintained anymore and
this makes it consistent with other Osmocom projects.

Avoids synchronizing with SysV scripts on debian:
  # systemctl enable osmo-gtphub
  Synchronizing state of osmo-gtphub.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
  Executing: /usr/lib/systemd/systemd-sysv-install enable osmo-gtphub

Change-Id: I9008944369314a4cbb345bfbf01bdb57aa7590fb
2024-05-22 13:33:52 +02:00
Oliver Smith
b3ce06058c sgsn/sgsn_vty: create state-dir
Prepare to change the state-dir in the default config in a follow-up
commit. Create the directory if it does not exist.

Change-Id: I8db4898cdaa2fcbd6bbf7c543764b9cdf828de83
2024-05-16 10:50:56 +02:00
Oliver Smith
0a6fe9727f debian/postinst: add checks, be verbose
Do not attempt to change permissions/ownership if the package gets
upgraded from a version higher than the next release.

Do not fail if the user deleted the config file.

Be verbose when changing permissions.

Related: OS#4107
Change-Id: I2b01a7625cf66fbb7d203f939ddcc1cbab43cf33
2024-05-14 15:21:06 +02:00
Oliver Smith
7ba62d3061 contrib: remove rpm spec file
Related: https://osmocom.org/news/255
Related: OS#6446
Change-Id: I9e7a3beb861faab1b6852aa5b57847c590986976
2024-05-13 08:39:35 +00:00
Vadim Yanitskiy
62b28ffe1b VTY: sync default UMTS UEA config with osmo-msc
As was reported in OS#6442, nano3g S16 is unhappy when CS and PS
domains use different UEA configuration for simultaneous RANAP
connections.  Bring osmo-sgsn in sync with osmo-msc to avoid this.

Change-Id: I4eb9451b4267fc1436ed90a55ff200cf36f16bf6
Related: OS#6442
2024-05-09 10:50:08 +02:00
Vadim Yanitskiy
cdf716cf9a VTY: move default settings to sgsn_instance_alloc()
It's cleaner to have all configuration defaults in one place.

Change-Id: I1a439dcc76272a181986b6ec9368ef16441dc098
Related: OS#6442
2024-05-09 10:48:29 +02:00
Oliver Smith
a9c39c04de .deb/.rpm: various fixes related to non-root
* Explicitly chown /var/lib/osmocom to osmocom:osmocom, instead of
  relying on systemd to do it when the service starts up. This does not
  work with the systemd versions in debian 10 and almalinux 8.
* deb: Use "useradd" instead of the interactive "adduser" perl script
  from Debian. This makes it consistent with how we do it in rpm, and
  avoids the dependency on "adduser".
* deb: Consistently use tabs through the file, instead of mixing tabs
  and spaces.
* deb: Remove support for the "dpkg-statoverride --list" logic. This
  seems to be a rather obscure feature to override permissions for
  certain files or directories, for which it does not seem to be a good
  idea to make the postinst script less maintainable. Something similar
  can be achieved by using your own Osmocom config file in a different
  path with different permissions.

Related: OS#4107
Change-Id: I406ff0d625b02991d580c8382aa4be04dba45a00
2024-05-08 06:46:32 +00:00
Vadim Yanitskiy
282de031f1 gmm: mmctx_timer_stop(): warn about timer not running
This turns errors like:

  DMM ERROR MM(262420000000038/e2ff704e) Stopping MM timer 3350 but 0 is running

into warnings with a more accurate reason:

  DMM NOTICE MM(262420000000037/e2ff704e) Stopping *inactive* MM timer 3350

Change-Id: I56ecad9d8f1049974b0896f6d0e7fc61580155ec
2024-05-01 10:44:27 +02:00
Vadim Yanitskiy
c3156193da gmm: cosmetic: fix preprocessor macro formatting
Change-Id: I77171d65db23794d8fd9872e0cc4d6f3b50dda0d
2024-05-01 10:44:27 +02:00
Alexander Couzens
cd3a8cfad6 docs: front page: use https:// instead of http://
Change-Id: If3c3b8e79f94da7a3bcc9262808da09f6a5a601c
2024-04-28 12:17:10 +00:00
Alexander Couzens
e51b3be379 docs: update year to 2024
Change-Id: I85a987eee470d2040c91289d33c5d97c3e90674d
2024-04-28 12:17:10 +00:00
Alexander Couzens
b34e0a5720 docs: replace legacy NS with new NS2 chapters
osmo-sgsn already switched to the new NS2 code. Use the correct
NS2 chapter

Change-Id: I9cc86d234e029b5192e36aeb14b0e39d1496842d
2024-04-28 12:17:10 +00:00
Oliver Smith
05363e0a32 contrib/osmo-sgsn.spec: fix build for almalinux:8
Add the missing "%if 0%{?suse_version}" around %service_del/add
commands, as these are only available on opensuse.

Fix for:
  error: line 106: Too many names: %preun  -n osmo-gtphub %service_del_preun   osmo-gtphub.service

Fixes: a07e6d9c (".deb/.rpm: add osmocom user during package install")
Change-Id: I89802f926bfccc0f7b4bb1ff64115b232b1db022
2024-04-26 09:58:51 +02:00
Max
a07e6d9c58 .deb/.rpm: add osmocom user during package install
Create osmocom user & group during package installation.
Fix the configuration dir/files permission to match.

Related: OS#4107
Tweaked-By: Oliver Smith <osmith@sysmocom.de>
Change-Id: I55ce205d4b314d01b2641c8f3d52455c051d6282
2024-04-24 11:52:50 +02:00
Harald Welte
1ede89a35a README.md: Add Forum and Issue Tracker sections
Change-Id: I69dfe4124c2a2be30c9ef04e70e3f15d10a2305c
2024-03-23 17:15:07 +01:00
Harald Welte
647304fbe5 README.md: Overhaul (more links; improved formatting)
Change-Id: I0cf9898877aab2f834c886491f4d203d55a8b4b9
2024-03-23 17:07:07 +01:00
Harald Welte
370d6e8b59 Add funding link to github mirror
see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository

Change-Id: Icf0fd068742eba60c23f0e567e6e72b42063f2c0
2024-03-23 17:03:36 +01:00
Pau Espin Pedrol
dc4c294f94 gsup: Use new libosmogsm struct osmo_gsup_pdp_info fields
This also makes sure it doesn't compile against older libosmogsm gsup
versions which would break ABI.

Change-Id: I0d03d368e73ab62ec631420769f6af91f2ff9987
Related: OS#6091
Depends: libosmocore.git Change-Id 70be3560659c58f24b8db529c4fc85da4bb0ec04
2024-01-29 11:07:03 +01:00
Vadim Yanitskiy
f2545b1b8f build: include README.md into the release tarball
Change-Id: Ia467ae8cc6eec0dc9fb36d4c159d2762e965c4f8
2024-01-26 23:37:30 +07:00
Andreas Eversberg
1f1d90f175 Use uniform log format for default config files
Related: OS#6272
Change-Id: I6b6aa5a5100cf0045dcba1b062acc9376d34b0ae
2023-12-01 12:40:54 +01:00
Oliver Smith
2a89bbf66f Bump version: 1.11.0.5-67677-dirty → 1.11.1
Depends: osmo-ggsn I1f116e1cded135f231f22ebc9b817aebf3736fc2
Change-Id: I869eef2032d6025c8ed59a1b25192c6c5c08977e
1.11.1
2023-11-28 13:43:15 +01:00
Daniel Willmann
676777c5f9 libgtp: Check for all successful create_pdp_conf causes
Related: OS#6268
Change-Id: I11ce72908c2dfb983887e6c1db316fd7de42f027
2023-11-23 18:00:07 +01:00