Commit Graph

41 Commits

Author SHA1 Message Date
Sukchan Lee a9b1b116b3 [SBI] Generate URI via HTTP.location as is (#3058)
A friend in the community was trying to connect an SMF made by another
manufacturer with an SBI interface and found a big problem with Open5GS.

All of the code in the part that generates the Resource URI
from HTTP.location is invalid.

For example, suppose we create a Resource URI with SMContext as below.
{apiRoot}/nsmf-pdusession/<apiVersion>/sm-contexts/{smContextRef}

In this case, Open5GS extracted the {smContextRef} part of the HTTP.location
and appended it to the beginning
{apiRoot}/nsmf-pdusession/<apiVersion>/sm-contexts/.

This implementation may not work properly if the apiRoot changes.
Consider a different port number as shown below.

<HTTP.location>
127.0.0.4:9999/nsmf-pdusession/v1/sm-contexts/1

The SMF may send an apiRoot to the AMF with a changed port number,
in which case the AMF must honor it.

Therefore, instead of extracting only the smContextRef from HTTP.location,
we modified it to use the whole thing to create a Resource URI.

We modified all NFs that use HTTP.location in the same way, not just SMFs.
2024-04-18 21:24:07 +09:00
gstaa eb2b19b39c
Include cause in HTTP response ProblemDetails (#3051)
Cause is set according to particular NF standard.

Additionally:
- OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED typo fixed.
- [PCF] Fixed SM Policy establishment error handling
2024-04-04 23:29:20 +09:00
Sukchan Lee e92293e0af
[SEPP] Initial Update for 5G Roaming (#2739)
[SEPP] Initial Update for 5G Roaming
2023-11-19 19:34:51 +09:00
Sukchan Lee e3c2fd00d9 [SBI] Do not raise ASSERT when not enough CLIENT pool (#2701) 2023-10-25 21:40:37 +09:00
Bostjan Meglic b2a2064beb [AF] Use correct structure when sending modification request
Tests were crashing due to AF using the wrong OpenAPI structure, while
the SBI library tried to convert a different structure to JSON.

Before the added support for nullable fields in OpenAPI documents, both
structures were identical.
2023-10-11 21:10:20 +09:00
Sukchan Lee d4f2b545a3 [SBI] Fixed invalid format of subscrCond (#2630)
The format of subscrCond must be 'oneOf'.
2023-09-24 09:01:59 +09:00
Sukchan Lee de7e0d3b45 [SBI] Fixed an issue with FQDN/TLS (#2252) 2023-04-21 22:37:07 +09:00
Sukchan Lee 32019df0f0 Fixed MacOSX compile error 2023-04-04 21:53:39 +09:00
Sukchan Lee ad9e5b28cf [SBI] Added Handler for Subscription PATCH (#2152) 2023-03-12 22:06:19 +09:00
Sukchan Lee 969c116e77 [SBI] Crash occurs when ENUM in the MAP (#2103) 2023-03-01 17:50:25 +09:00
Sukchan Lee 05fbaf6958 [SBI] HTTP2-TLS verification - ConfFile Changed
You should add the following configuration if you would not use TLS.

sbi:
    server:
      no_tls: true
    client:
      no_tls: true
2023-02-18 10:58:29 +09:00
Bostjan Meglic 474b2d4134 [SBI,NF] Don't treat SBI connection errors as asserts 2023-02-07 22:49:11 +09:00
Sukchan Lee bae3998c31 [SBI/NF] Follow-up on #2045 2023-02-04 21:35:12 +09:00
Bostjan Meglic c791d97ed7 [NF] Fix double-free crash when NF is under heavy load
<nf>/init.c:<nf>_main() :
ogs_pollset_poll() receives the time of the expiration of next timer as
an argument. If this timeout is in very near future (1 millisecond),
and if there are multiple events that need to be processed by
ogs_pollset_poll(), these could take more than 1 millisecond for
processing, resulting in the timer already passed the expiration.

In case that another NF is under heavy load and responds to an SBI
request with some delay of a few seconds, it can happen that
ogs_pollset_poll() adds SBI responses to the event list for further
processing, then ogs_timer_mgr_expire() is called which will add an
additional event for timer expiration. When all events are processed
one-by-one, the SBI xact would get deleted twice in a row, resulting in
a crash.

0  __GI_abort () at ./stdlib/abort.c:107
1  0x00007f9de91693b1 in ?? () from /lib/x86_64-linux-gnu/libtalloc.so.2
2  0x00007f9de9a21745 in ogs_talloc_free (ptr=0x7f9d906c2c70, location=0x7f9de960bf41 "../lib/sbi/message.c:2423") at ../lib/core/ogs-memory.c:107
3  0x00007f9de95dbf31 in ogs_sbi_discovery_option_free (discovery_option=0x7f9d9090e670) at ../lib/sbi/message.c:2423
4  0x00007f9de95f7c47 in ogs_sbi_xact_remove (xact=0x7f9db630b630) at ../lib/sbi/context.c:1702
5  0x000055a482784846 in amf_state_operational (s=0x7f9d9488bbb0, e=0x7f9d90aecf20) at ../src/amf/amf-sm.c:604
6  0x00007f9de9a33cf0 in ogs_fsm_dispatch (fsm=0x7f9d9488bbb0, event=0x7f9d90aecf20) at ../lib/core/ogs-fsm.c:127
7  0x000055a48275b32e in amf_main (data=0x0) at ../src/amf/init.c:149
8  0x00007f9de9a249eb in thread_worker (arg=0x55a483d41d90) at ../lib/core/ogs-thread.c:67
9  0x00007f9de8fd2b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
10 0x00007f9de9063bb4 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
2023-02-04 21:25:46 +09:00
Sukchan Lee b7386284a7 [NRF] Fixed a crash during NRF discovery (#2034)
Other NF instances are obtained through NRF
or created directly through configuration files.

Other NFs created by the config file should not be passed
through NRF discovery or anything like that.

Since self-created NF Instances do not have an ID,
they are implemented to exclude them from NRF Discovery.
2023-01-29 11:22:45 +09:00
Sukchan Lee c6fd4ae6b8 [LOG] remove ogs_expect_or_return()/return_val() 2023-01-24 00:01:36 +09:00
Sukchan Lee 57f1f2c21a Fixed crash after 48 hours of running (#1893) 2022-11-18 23:28:35 +09:00
Sukchan Lee 0859dd4453 Follow-up on #1865 2022-11-12 09:37:43 +09:00
Sukchan Lee 5ccb5f0f99 SCP(Model D) is now the default setting. 2022-10-22 11:26:04 +09:00
Sukchan Lee f54bccacf5 Support service-based NF subscription 2022-09-08 22:12:01 +09:00
Sukchan Lee 5295c108ad Added Service-based NF discovery
== Known limitation ==
Placing npcf-smpolicycontrol and pcf-policyauthorization
in different NFs is not supported. Both npcf-smpolicycontrol
and pcf-policyauthorization should be placed in the same NF.
2022-09-02 23:04:57 +09:00
Sukchan Lee 9f98d421a0 [SBI] Added config for service-names discovery 2022-08-27 10:49:07 +09:00
Sukchan Lee f020732ce9 [SBI] Support service-names in discovery option 2022-08-27 00:12:22 +09:00
Sukchan Lee e6a14cb73d Move src/../nf-sm.[ch] to lib/sbi/nf-sm.[ch] 2022-08-12 14:03:53 +09:00
Sukchan Lee 7231dafbf1 [SBI] Fixed nf_instance memory leak
- Rollback commit ed3444eef5
- Do not modify reference count when REGISTER/DEREGISTER notified from NRF
2022-08-02 09:44:13 +09:00
Sukchan Lee a5010a61ef Support Discovery Optional Parameter (#1671)
To support target-nf-instance-id in the discovery,
Discovery optional parameter is implemeted
2022-07-24 15:10:09 +09:00
Sukchan Lee 9aa5559c5f Refactor for the UERANSIM 500 test (#1652) 2022-07-21 12:41:19 +09:00
Sukchan Lee 5e18b2bd13 [SCP] Support of Indirect Communication 2022-07-16 13:27:18 +09:00
Sukchan Lee c528e0d5bc [SBI] Change NfInstance.Id to Optional 2022-06-18 23:56:12 +09:00
Bostjan Meglic 2c2ce143a3
Fix minor typos (#1554)
* Fix minor typo in log output

* Remove unused struct members
2022-05-24 21:01:54 +09:00
Sukchan Lee e5ff03b249 [SBI] Change the reference count (#1440)
Change the client's reference count method
to use the same method as nf_instance
2022-04-10 20:09:27 +09:00
Sukchan Lee ed3444eef5 Need to increase NF ref_count
1. UE registered and PDU established.
2. PCF does not receive Heartbeat.
 - PCF De-registered state.
 - Since PDU is established, SMF should not remove NF instance
3. PCF re-registered.
 - HERE, WE NEED TO INCREASE NF REFERENCE COUNT.
   Otherwise, NF instance will be removed if PCF is de-registered state
4. UE sends PDU release request.
5. Because SMF knows PCF NF instance, SMF can send PCF delete
2022-03-01 22:02:02 +09:00
Sukchan Lee 3b275edec7 [SBI] Remove one octet length in FQDN (#1333) 2022-01-23 13:49:03 +09:00
Sukchan Lee 866ae78f5e [NRF] fix the crash for invalid FQDN (#1333) 2022-01-22 09:34:38 +09:00
Sukchan Lee 0fb8279e36 VoNR added but not tested! 2021-11-14 21:07:56 +09:00
Sukchan Lee 13f1b390ae CVE-2021-41794 from NCC Group by Mark Tedman
When connecting to the UPF port for the PFCP protocol (8805) and sending
an association setup request followed by a session establishment request
with a PDI Network Instance set to ‘internet’, it causes a stack corruption
to occur.

So, ogs_fqdn_parse() fixed.
2021-10-01 22:41:03 +09:00
Sukchan Lee 831b29973f [PCF] fix the 'NULL' AfEvent in VoNR (#1120) 2021-08-08 09:10:37 +09:00
Sukchan Lee 118d62d42d Add more memory log 2021-06-06 22:35:46 +09:00
Sukchan Lee ef07ccfb88 fix the default SBI port (#997, #1008) 2021-05-30 10:35:01 +09:00
Sukchan Lee 899c121478 remove warning in MacOSX 2021-05-29 16:03:40 +09:00
Sukchan Lee fe89f7cd11 [5GC] Added BSF(Binding Support Function) 2021-05-29 15:56:12 +09:00