Commit Graph

3743 Commits

Author SHA1 Message Date
Sukchan Lee fce0eb4800 [SBI] fixed wrong request-nf-type (#1650) 2022-07-08 21:36:52 +09:00
Oliver Smith fe11ee161c d/open5gs-upf.postinst: don't restart service in chroot
Don't attempt to restart systemd-networkd if systemd is not running
(e.g. installing open5gs inside a chroot).

Fix for:
  System has not been booted with systemd as init system (PID 1). Can't operate.
  Failed to connect to bus: Host is down
  dpkg: error processing package open5gs-upf:amd64 (--configure):
   installed open5gs-upf:amd64 package post-installation script subprocess returned error exit status 1
2022-07-05 10:22:36 +09:00
Sukchan Lee eabe8dfec5 [PFCP] Added UE IP address in the EPC (#1642) 2022-07-04 17:37:00 +09:00
Networkmama 29525b21a4 [SMF] copy UE ip address to uplink PDR rules.
This helps UPF to add ACL based on src ip

Signed-off-by: Networkmama <networkmama12@gmail.com>
2022-07-04 17:34:40 +09:00
Sukchan Lee af4021bff4 [PFCP] Fixed a endianness Apply Action (#1640) 2022-07-04 17:30:19 +09:00
Sukchan Lee 318fc25535 [CORE] Added memory check (#1638) 2022-07-01 21:49:31 +09:00
Bostjan Meglic 6adf541346 [CORE] Fix detection of a failed memory allocation 2022-07-01 21:38:47 +09:00
Bostjan Meglic ab11220dcc [ALL] Fix differences in function parameter names between definition and declaration 2022-07-01 21:38:47 +09:00
Bostjan Meglic 114f783d06 [MISC] Add support for static code analysis
Static code analysis can be executed with following commands:
  meson build
  ninja -C build analyze-cppcheck
  ninja -C build analyze-clang-tidy

These commands are available only if additional tools are installed:
  - cppcheck
  - clang-tidy
  - clang-tools is optional if you want to paralelize the clang-tidy

In case of cppcheck analysis, a file called build/cppchecklog.log is
created with the analysis results.

In case of clang-tidy analysis, some checks are disabled. See file
.clang-tidy, and reenable them if you see fit.
Also it does not scan all the files in the project, since some of them
are imported from other sources. It does not scan any sources under:
  - subprojects/
  - lib/asn1c/
  - lib/ipfw/
2022-07-01 21:38:47 +09:00
Sukchan Lee 50be661cf9 Fixed a crash when slice/session overflow (#1637) 2022-06-30 13:33:16 +09:00
Sukchan Lee ad159d1755 [GTP] Refine error code path without assertion
Refer to #1635, #1620, #1606, #1594
2022-06-30 10:53:19 +09:00
Sukchan Lee b1d982a1ee [PFCP] Refine error code path without assertion
Refer to #1635, #1620
2022-06-30 10:35:03 +09:00
Sukchan Lee 0be5e765c8 Revert "[SGWC] pfcp: Retrieve sess when SEID=0 (#1620)"
This reverts commit 9700563023.
2022-06-30 09:11:38 +09:00
Sukchan Lee 6332f10593 Revert "[GTP] context when TEID=0 (#1620, #1606, #1594)"
This reverts commit 0d61f7a7f9.
2022-06-30 09:11:31 +09:00
Sukchan Lee 051c19b7c8 Changes MAX TLV MORE to 16
OGS_MAX_NUM_OF_PDR is 16, but OGS_TLV_MAX_MORE is 8.
To match the size of two macros, increased OGS_TLV_MAX_MORE to 16.
2022-06-29 14:35:01 +09:00
Pau Espin b5956e5596
[UPF] N4: Remove unnecessary assert (#1634) 2022-06-29 11:10:43 +09:00
Sukchan Lee 52d5c61794 [GTP] avoid abort for ogs_gtp_node_new() (#1633) 2022-06-29 11:07:44 +09:00
Pau Espin c5a545039f
[GTP] Avoid abort if ogs_gtp_node_new() returns NULL (#1633)
* [GTP] Avoid abort if ogs_gtp_node_new() returns NULL

* [SGWC] Avoid abort if ogs_gtp_node_add_by_addr() returns NULL
2022-06-29 10:28:18 +09:00
Sukchan Lee 2dd577f88c [SCTP] Add protection code jumbo frame (#1632) 2022-06-28 16:58:15 +09:00
Sukchan Lee 0d61f7a7f9 [GTP] context when TEID=0 (#1620, #1606, #1594) 2022-06-28 15:32:14 +09:00
Sukchan Lee 9700563023 [SGWC] pfcp: Retrieve sess when SEID=0 (#1620) 2022-06-28 13:20:46 +09:00
Pau Espin 5eaf66262a
[SMF] pfcp: Retrieve sess when response with SEID=0 is received (#1620)
3GPP TS 29.244 7.2.2.4.2 documents that the peer will set SEID=0 in the
response when we request something for a session not existing at the peer.
If that's the case, we still want to locate the local session which
originated the request, so let's store the local SEID in the xact when
submitting the message, so that we can retrieve the related SEID and
find the session if we receive SEID=0.
2022-06-28 11:19:57 +09:00
Pau Espin a3593c6890
[SMF] Gn: QoS Profile and PCO IE improvements (#1631) 2022-06-27 21:51:14 +09:00
Sukchan Lee 8fe2e506c0 [PFCP] Added Network Instance to CP-UP FAR (#1630) 2022-06-25 07:56:28 +09:00
Sukchan Lee df68b231b8 [PFCP] Added DNN/APN in FAR (#1629, #1630) 2022-06-24 20:30:40 +09:00
Sukchan Lee f4eddf91b5 Set v4/v6 flags in local F-TEID (#1625) 2022-06-24 15:16:54 +09:00
Networkmama 99fd6c449a
[SMF] Set v4/6 flag in F-TEID IE request type (#1625)
Signed-off-by: Networkmama <networkmama12@gmail.com>
2022-06-24 15:11:16 +09:00
Pau Espin 7762da6992
[SMF] pfcp-sm: Fix ogs_fsm_dispatch() on NULL sess (#1628)
It was spotted that if DeleteSessionReq sent by SMF is answered by UPF
with cause="Session context not found", then it contains SEID=0 (this is
correct as per specs). Hence, since SEID=0 session is not looked up, so
sess=NULL.

A follow up commit improves the situation by looking up the SEID in the
originating request message in that case.
2022-06-23 23:38:52 +09:00
Pau Espin bfe214aafa
[UPF] Avoid crash if no default subnet configured (#1624)
In that case, ogs_pfcp_ue_ip_alloc() will fail with  the error message
"CHECK CONFIGURATION: Cannot find subnet [...]" and the assert will make
upf crash.
That's not desirable, let's keep it running and simply reject the
request. The error log is big enoguh to find out.
2022-06-23 22:04:01 +09:00
Pau Espin 96d689a402
[SGWC,SMF] Add specific config opt max.gtp_peer to set gtp_node mempool size (#1623)
This is needed specially for SMFs handling a pool of SGWs.
2022-06-23 22:03:48 +09:00
Pau Espin 3501cb0a5b
[SMF] track and fix scenario where gtp node mempool becomes full (#1622)
* [SMF] Avoid abort() if gtp_node mempool becomes full

Related: https://github.com/open5gs/open5gs/issues/1621

* [SMF] metrics: Add new ctr tracking gtp_node allocation failures

This metrics is useful to track whether at some point the mempool went
full, so that config needs to be updated to increase the mempool size.
2022-06-23 22:03:34 +09:00
Sukchan Lee b58ebda556 Change Default MCC/MNC 901/70 -> 999/70 (#1331) 2022-06-23 21:37:47 +09:00
Pau Espin 20d3dc0167
[CORE] fsm: Add asserts to validate ogs_fsm_t is not null (#1619) 2022-06-23 20:48:06 +09:00
Bostjan Meglic c9598fb9c6
[SBI] Fix memory leak for nghttp2 session (#1618)
Delete nghttp2 session to prevent memory leaks.
The issue was detected using valgrind.
2022-06-23 20:43:36 +09:00
Pau Espin 13421119c3
[SMF] Gy: Send Multiple-Services-Indicator AVP only during Initial CCR (#1616)
Gy (3GPP TS 32.299 ) refers to AVP in DCCA (RFC4006).

RFC4006 5.1.2:
"[...] by including the Multiple-Services-Indicator AVP in the first
interrogation."

Nokia's infocenter documentation also states it's sent during Initial CCR
only: "(CCR-I only)".
2022-06-21 23:56:56 +09:00
Sukchan Lee 50cfb5f3ac Initialize pgw_s5u_teid (#1559) 2022-06-20 22:36:51 +09:00
Bostjan Meglic d2cbcf7118
[build] Use local sources to build applications (#1583)
"build" Docker image previously downloaded latest version of Open5GS
from github, and built the project from that.
Use local source files for building instead.
2022-06-19 18:18:09 +09:00
Sukchan Lee 0f93ec23ab [MME/AMF] Fixed network name encoding (#1614) 2022-06-19 18:16:11 +09:00
Sukchan Lee c528e0d5bc [SBI] Change NfInstance.Id to Optional 2022-06-18 23:56:12 +09:00
JagannathS 0313910ac6
Added show commands in the dbctl (#1613) 2022-06-17 06:27:24 +09:00
Bostjan Meglic 361c3b7387
[SBI] Fix invalid read beyond allocated memory (#1610)
Valgrind memcheck tool reports an error, of invalid read beyond the
allocated memory.

Function "write_cb()" already allocates (realloc) +1 byte and
null-terminates the data. But the length "conn->size" does not contain
this extra null-terminated byte.
When a copy of the received data is made in "check_multi_info()", it
does not include the null character, resulting in potentially a
non-null terminated string.
Later on when parsing the data, "strlen()" will read beyond the
allocated memory to search for the null character, resulting in an
invalid read.

==1994== Invalid read of size 1
==1994==    at 0x484ED24: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1994==    by 0x4D3F401: cJSON_ParseWithOpts (cJSON.c:1109)
==1994==    by 0x4D3F65C: cJSON_Parse (cJSON.c:1197)
==1994==    by 0x4C927DE: parse_json (message.c:913)
==1994==    by 0x4C972D8: parse_content (message.c:1790)
==1994==    by 0x4C90096: ogs_sbi_parse_response (message.c:589)
==1994==    by 0x136431: amf_state_operational (amf-sm.c:248)
...
==1994==  Address 0x668371d is 0 bytes after a block of size 253 alloc'd
==1994==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1994==    by 0x5107D7F: ??? (in /usr/lib/x86_64-linux-gnu/libtalloc.so.2.3.3)
==1994==    by 0x510814B: _talloc_memdup (in /usr/lib/x86_64-linux-gnu/libtalloc.so.2.3.3)
==1994==    by 0x4871568: ogs_talloc_memdup (ogs-strings.c:184)
==1994==    by 0x4CA7755: check_multi_info (client.c:475)
...
2022-06-15 22:32:23 +09:00
jmasterfunk84 59a457fa40
Update mme-sm.c (#1609) 2022-06-15 06:13:49 +09:00
Pau Espin 038d383584
[CORE] Compare port in ogs_sockaddr_is_equal() (#1608) 2022-06-15 06:13:15 +09:00
Bostjan Meglic 7be7029ac4
Send deregistration event from AMF to UDM (#1599)
* [SBI] Fix converting PatchItem to JSON

* [UDR] Add support for endpoint for patching subscription data

Add support for PATCH HTTP method for the following endpoint:
/subscription-data/{ueId}/context-data/amf-3gpp-access

Currently does not change any data in the database.

* [UDM] Add support for endpoint for patching subscription data

Add support for the following endpoint, HTTP PATCH method:
/nudm-uecm/v1/{ueId}/registrations/amf-3gpp-access

The endpoint is used when UE deregisters from the core, and AMF
sends a subscription modification request with "purgeFlag" set.

* [UDM] Add check for same GUAMI when patching subscription data

* [AMF] Send deregistration event to UDM

When UE sends deregistration request, AMF needs to send a
Nudm_UECM_Deregistration request to UDM.
The order of requests is now the following:
- send PDU session release to SMF
- send deregistration event to UDM
- send AM policy control release to PCF
2022-06-14 23:44:02 +09:00
Pau Espin 720b4d3c4c
[SMF] Gn: Drop already implemented TODO (#1604) 2022-06-13 23:58:39 +09:00
Pau Espin 4d9112870c
configs: use proper default IP address for metrics server (#1603)
* configs: use proper default IP address for metrics server

Let's use the IP address assigned to each process by default when
configuring the HTTP Prometheus server. Otherwise having several
processes listening on 0.0.0.0 cause collisions.

* configs: mme.yaml: Fix trailing whitespace
2022-06-13 23:13:58 +09:00
Safa Orhan 58a9d31fd8
Apply action ie (#1601) 2022-06-13 19:51:40 +09:00
Safa Orhan 0a3746c24d
PR open5gs#1581 (#1600) 2022-06-13 19:44:36 +09:00
Sukchan Lee 1daac541cf Oops! removed one time in the document 2022-06-12 17:18:03 +09:00
Sukchan Lee 9087a480a8 Update document for v2.4.8 2022-06-12 17:06:36 +09:00