Commit Graph

599 Commits

Author SHA1 Message Date
Harald Welte a713b33792 Bump version: 1.8.0.21-fbd0 → 1.8.1
Change-Id: If84e8cf8769550c97552832c5cb97ebba830341d
2023-10-17 13:11:25 +02:00
Harald Welte fc41f32275 Fix counting received IPA packets in server mode
When operating an IPA ASP in server mode, we were not counting the
packets using the related stat item:

For example:

OsmoSTP# show stats
Ungrouped counters:
SIGTRAN Application Server Process (6)('asp-dyn-5'):
 Total number of packets received:        0 (0/s 0/m 0/h 0/d)
 Total number of packets transmitted: 235370503 (129/s 7682/m 442447/h 11342653/d)

This patch adds the missing counter increment.

back-port of Change-Id I75881d115b5c2c2567c4731bcf2cabe11f367117 from master
Closes: SYS#6600

Change-Id: I96488e4ea10e00f5f03387e33dc58e4b5016458f
2023-10-17 13:05:15 +02:00
Pau Espin 15efbbdba4 Bump version: 1.7.0.56-abf26-dirty → 1.8.0
Change-Id: I563bba2eaca7f569a5216fb8268122c0f55ef48b
2023-09-12 14:03:25 +02:00
Pau Espin abf26ce1ad Allow configuring per-ASP SCTP INIT parameters
Related: SYS#6558
Depends: libosmo-netif.git Change-Id I5343c7659881b29e0201e72badbc2d07e1ef2dca
Change-Id: I4c104f0313b549efab7fae2e81a163474e9bcd4b
2023-09-08 18:14:52 +02:00
Pau Espin 13a341e813 asp,xua_srv: Use new osmo_stream API to request sockopt SCTP AUTH/ASCONF SUPPORTED
Support to enable AUTH/ASCONF in the SCTP socket was added recently in
libosmocore and libosmo-netif, in order to support the Peer Primary
Address features used by the libosmo-sccp code.
The code to request the AUTH/ASCONF support through setsockopt() was
internally applied transparently by lisbosmo-netif's osmo_stream. This
is not 100% disarable since other users of the library may not need/want
that behavior.
As a result, libosmo-netif's osmo_stream no longer enables the SCTP
AUTH/ASCONF support by default, but it must be enabled through
the new osmo_stream_{cli,srv_link}_set_param() API.

This change in behavior of the API/implementation can be done because
all these new features are pretty new and no release of
libosmocore/libosmo-netif/libosmo-sccp has been released yet.

Related: SYS#6501
Related: SYS#6558
Depends: libosmo-netif.git Change-Id I2607c1c926a625986cd851adc65dd8b4de83d6ab
Change-Id: I16c97fc148792aa3e39b7414899660990c39dfff
2023-09-08 18:14:37 +02:00
Pau Espin 0937875983 ss7: Split asp and xua_server into their own files
This allows having a clearer picture of the several entities involved,
as well as simplifying the files.

In the future, we can do the same for AS, route, etc. and leave osmo_ss7
for the "instance" object.

Change-Id: I3d43268459d61b0b9f9bec34bf31dc0851fa5e48
2023-09-07 13:14:51 +02:00
Pau Espin 08cb70e158 ss7: Drop unneeded else branch after early return
Change-Id: I845be6bfbf36ec8a38697ca92420483a9d41aa6c
2023-09-07 12:59:44 +02:00
Pau Espin d01c45918d ss7: Rename internal APIs to avoid exporting them in so file
Change-Id: Ibb22c1dc1ec73fc574cc3d38664874114f681c37
2023-09-07 12:48:52 +02:00
Harald Welte 4c1751ddca m3ua: Add some TODO comments on where we fall short of our potential
Change-Id: I75d7b8f3fb6a06f6941b6dff4072287fdbb1d33e
2023-09-01 10:39:20 +02:00
Harald Welte b93e1d0120 ipa: use LSBs of file descriptor as SLS in IPA->M3UA direction
when IPA/SCCPlite traffic traverses the osmo_ss7 stack, so far the
SLS of the MTP3 label was always set to 0 (default initialization).

However, in order to achieve a better distribution of signaling traffic
in SS7 networks that actually utilize the SLS to select any links (or
ASPs), it makes sense to use non-zero values.

Instead of introducing some kind of new, configurable attribute for
each ASP (IPA client connection), let's simply use the lower 4 bits of
the file descriptor integer.  Those file descriptors should have a
roughly equal distribution, resulting in traffic (from multiple IPA
clients) to be spread across the 4-bit SLS number space.

Also, this mechanism ensures that traffic from one IPA client will
always get the same SLS and hence routed the same way in any underlying
CS7/SS7 network.

Change-Id: Ice7bab997b84cfed00c7d6d780c70f4e9fac6002
Related: SYS#6543
2023-09-01 10:28:14 +02:00
Pau Espin 1edd02bb3b asp: Monitor SCTP_PEER_ADDR_CHANGE events to re-apply configured Primary Address
The kernel doesn't store state about a "always-preferred" Primary
address, it simply applies the requested one at the time the request is
done. If afterwards the remote address becomes unavailable, the kernel
will end up giving up on it and selecting anoter one as primary address.

If the VTY-configured Primary Address become available after a while
(signaled by the kernel in the SCTP_PEER_ADDR_CHANGE), make sure to
apply it again.

Similary, if the peer sends us an ASCONF changing our Primary Address,
we should discard that and apply/overwrite *iff* the user explicitly
VTY-configured one (kernel announces the change through
SCTP_ADDR_MADE_PRIM in this scenario).

Related: OS#6076
Change-Id: I2e54e6f9e424350474db6dec6ab604b33a03f88b
2023-08-21 13:01:47 +02:00
Pau Espin 8b8458d153 asp: Allow setting IP address as SCTP primary upon conn establishment
This is an initial implementation to set the local SCTP Primary address
as well as the peer's Primary Address (through SCTP ASCONF messages).
The Primary address is only set upon conn establishment (after connect()
 for clients, or accept() for severs), which means no logic is
introduced to make sure that primary address is kept during the entire
operation of the SCTP association (for instance if the Primary address
becomes unavailable and the stack changes the primary, and later on that
address becomes available again, the primary addres won't be set back to
the initially configured one).

Related: OS#6076
Change-Id: I4a9fc1a4ad82ed20ece328bc53fca58299d744ca
2023-08-21 12:23:52 +02:00
Pau Espin 58fd289443 ss7: Use libosmo-netif's osmo_stream_{cli,srv}_recv() APIs
Since libosmo-netif.git Change-Id
I4cb94d264109f1b763cccd44c6ba049cc7509319, we receive SCTP notifications
in both client and srv, so there's no real need to use sctp_recvmsg()
directly.

Change-Id: If3d78b636e8e224aa9c8597d0b242e29d3e3c84e
2023-08-07 19:58:14 +02:00
Pau Espin f9852ae077 ss7: Log addr and event state for SCTP_PEER_ADDR_CHANGE
Change-Id: I989f0180dab25cd6fb1a0c0a49c04a03be118ba3
2023-08-07 17:11:49 +02:00
Pau Espin a18f907aaf cosmetic: Fix pointer location format
Caught by linter:
ERROR:POINTER_LOCATION: "foo* const* bar" should be "foo * const*bar"

Change-Id: Icb3adff115e77fca273fdbfda6c7de1ddf1b61cd
2023-08-03 17:14:08 +02:00
Pau Espin 4ddaee9362 asp: Make ASP default LM timers VTY configurable
Related: SYS#6511
Change-Id: Ib62e19f2e528e8b2792cbb51a5900dc3463ebd06
2023-07-11 14:56:26 +02:00
Pau Espin 5cf725b191 ss7: Refactor osmo_ss7_asp_find_or_create()
Move allocation code to its own function. Simplify
osmo_ss7_asp_find_or_create() code paths.

Change-Id: Ibbf20c63fc1d2b22a7c5d750002f94795ee31f26
2023-07-11 14:55:17 +02:00
Pau Espin c086a8ed42 sccp: Use tdef to implement osmo_sccp_timers
Related: OS#4372
Change-Id: I1dbe49a83a1bcddf074d5e638babd065834a0ebd
2023-07-11 14:55:14 +02:00
Harald Welte 1532791798 M3UA/SUA: Don't add empty routing context IE in DUNA/DAVA/DUPU
Before this patch, the code generating a DUNA or DAVA message would
potentially generate a ROUTE_CTX IE with zero-length content, rather
than skipping such an IE altogether if no routing context[s] are given.

Change-Id: I19d0382cd2d428a91ac716182b9d86dcdc2c2ebd
Related: SYS#6511
2023-07-10 08:36:40 +00:00
Pau Espin 7afbc23c2d xua_default_lm_fsm.c: Log rx ASP_UP timeout with NOTICE level
Some user run into this scenario recently and it was difficult to find
out why the SCTP links were being restarted. Add a new log line with
NOTICE level explicitly stating the reason to restart the ASP.

Related: SYS#6511
Change-Id: I5a388d2d96bcf1cbb76981c476abf37dbe213df0
2023-07-09 07:18:31 +00:00
Pau Espin a8aab23588 vty: Improve output of show cs7 instance <0-15> asp
Role and SCTP Role are now printed. Several formatting issues are fixed
or improved.

Related: SYS#6488
Change-Id: Id22bd4e74fb6f79950adba58862d379203d36760
2023-06-27 16:49:55 +02:00
Pau Espin 1470379c27 Set stream_cli/srv name to contain ASP + sockname
Upon connect/accept, update the name to contain both the ASP and the
sockname of the established socked. This allows easily identifying the
stream based on IP layer as well as upper xUA layer.

Example logs:
"""
stream.c:1193 SRV(m3ua,::1:2905) accept()ed new link from ::1 to port 2905
stream.c:1672 SRVCONN(asp-dyn-0,(r=::1:43568<->l=::1:2905)) connected read/write (what=0x1)
stream.c:1589 SRVCONN(asp-dyn-0,(r=::1:43568<->l=::1:2905)) message received
"""
"""
stream.c:521 CLICONN(asp0){CONNECTING} connection established
stream.c:552 CLICONN(asp0,(r=::1:2905<->l=::ffff:127.0.0.2:35911)){CONNECTED} connected read
stream.c:401 CLICONN(asp0,(r=::1:2905<->l=::ffff:127.0.0.2:35911)){CONNECTED} message received
"""

Depends: libosmo-netif.git I539a0d29d11348efe702f971965a55cf56db5c59
Change-Id: I05bc5f6c7795f62c1814c1c774287b41ee85a475
2023-06-20 19:52:46 +02:00
Pau Espin af768c716a Add osmo_ss7_asp getters for name and proto
Some apps such as osmo-bsc are accessing some of those fields, so better
add a getter API to make it easier to update the struct contents.

Change-Id: If9acfca1abc9ab7eb6d2388f548d7ee577b9c5ac
2023-06-20 14:11:46 +02:00
Pau Espin 5d30f648f4 Forbid partial VTY configurations of ASPs with name asp-clnt-*
A recent commit (83db938859) changed the
behavior of default "sctp-role" and "role" values of ASPs named
asp-clnt-* which are used by osmo_sccp_simple_client_on_ss7_id(), in
order to avoid having different default values when than function is
used, which is totally confusing for end users.

As it was already informed when submitting the mentioned commit, it
changes the behavior on that specific case, and that made some users
start having problems without a proper "your config is wrong!" error.

This commit addresses it by basically forbiding that exact use case,
that is, partially defining an asp-clnt-* ASP through VTY without
explicitly configuring a "role" and "sctp-role". With this patch,
function osmo_sccp_simple_client_on_ss7_id() will print a proper error
informing the user and will return NULL, potentially triggering an early
program exit which can then easily be fixed by using proper
configuration.

Related: SYS#6486
Change-Id: I65b5fad2ec06a9d9c521f1e3ce8aab633da95a47
2023-06-16 18:18:35 +02:00
Pau Espin 83db938859 osmo_sccp_simple_client_on_ss7_id(): Always follow VTY config of ASP if it was explicitly defined in VTY
The VTY config defaults are "role sg" and  "sctp-role server".
However, if not set explicitly in VTY,
osmo_sccp_simple_client_on_ss7_id() was replacing them to "role asp" and
"sctp-role client".
This is fine if the ASP is not defined/created at the VTY (aka
dynamically created with no config), but if the ASP is defined in the
VTY it becomes really confusing, since it's picking different defaults
than the usual ones.

Hence, follow always the same VTY defaults in
osmo_sccp_simple_client_on_ss7_id().

As a result of this change:
- Programs not defining the ASP over VTY keep the same behavior (ASP is
  created with role=asp and sctp-role=client)
- Programs defining ASP over VTY (eg. "asp asp-clnt-msc-0 5000 0 m3ua")
  explicitly setting "role" and "sctp-role": keep the same behavior
- Programs defining ASP over VTY but not explicitly setting "role" or
  "sctp-role", will get now the usual defaults instead.

So in summary, strange cases where osmo_sccp_simple_client_on_ss7_id()
is used (osmo-bsc, osmo-hnbgw, osmo-msc) and the dynamically created
ASP is created through VTY, then the config file must also explicitly
define the following lines:
role asp
sctp-role client

This patch also changes the "show running-config" VTY cmd to also always
show the configured role and sctp-role values, which are of vital
importance to understand a given setup.

Change-Id: Ie81987265118e48173211f88b27a006115dc62d4
2023-06-13 20:07:18 +02:00
Pau Espin 0aff5d101d osmo_sccp_simple_client_on_ss7_id(): Support ASP explicitly configured as sctp server
Right now, if a user configures an cs7 instance, as and asp (with
sctp-role server) in the VTY, then the function
osmo_sccp_simple_client_on_ss7_id() (used by osmo-bsc, osmo-msc,
osmo-hnbgw, etc.) will silently change the config to be SCTP client.
This is really confusing, since the user configured explicitly the ASP
as server but ends up running as client.
Instead, if the user explicitly configured the ASP as SCTP server,
allow it (after validating the user also properly configured a xUA
server through VTY).

Change-Id: I20de33edb8751a515d6719c49efadfc387dd85f8
2023-06-13 20:05:58 +02:00
Harald Welte 2a0ccafbf8 cosmetic: fix various typos in comments, log messages and VTY strings
Change-Id: I9a8afc07ae278100ffe34407db0e196f0c9ce8af
2023-06-13 17:24:27 +02:00
Vadim Yanitskiy 1f50d451a0 copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH
Change-Id: Ibb6e904b3a2bb6e569bed76cad5e0c982e055612
2023-05-18 17:22:26 +07:00
Neels Hofmeyr 083ea4b1fc add public API: osmo_sccp_instance_next_conn_id()
In struct osmo_sccp_instance, we have a next_id, to find an unused SCCP
connection ID. This is used for inbound SCCP connections.

At the same time, in each of our SCCP client programs, we have a
separate mechanism to find a connection ID for outbound connections.

See for example bsc_sccp.c: bsc_sccp_inst_next_conn_id()

It makes much more sense for callers to use the same
osmo_sccp_instance->next_id counter:

- Currently the inbound and outbound counters go out of sync: For
  example, in osmo-bsc, if we have three MS doing a usual Complete Layer
  3, osmo-bsc's counter increments by three. If we then have one
  Handover Required coming back from the MSC, i.e. inbound SCCP
  connection, the sccp_inst->next_id is behind by three, and will
  iterate SCCP connections three times before finding an unused id.

- Each implementation has to take care to properly wrap the ID in its
  valid range, e.g. in osmo-bsc:

                test_id = (test_id + 1) & 0x00FFFFFF;
                if (OSMO_UNLIKELY(test_id == 0x00FFFFFF))
                        test_id = 0;

Add public API so that callers can benefit from the internal
osmo_sccp_instance->next_id and do not need to duplicate the code for
staying within the proper range.

Change-Id: If59d524fbe1088a59ae1b69908e2d4bf67113439
2023-05-10 02:17:07 +02:00
Neels Hofmeyr 8bc881f31a sccp_scoc.c: fix infinite loop on conn ID exhaustion
Looking for an unused SCCP connection ID has no exit condition if all
connection IDs are in use. However unlikely it is that there are
16777215 active connections on one SCCP instance, add an exit condition.

Do so by implementing the ID lookup in a new separate function, which
qualifies for public API (upcoming patch).

So far, use an exit condition closest to previous behavior: iterate the
entire SCCP conn id number space before exiting in failure.

Change-Id: Ib64e0cb1ae0cc8b7bebcb2a352d4068b496b304a
2023-05-10 02:17:04 +02:00
Neels Hofmeyr d5139548f2 add osmo_sccp_set_max_optional_data()
So far, the optional data limit can only be modified via cs7 VTY,
because struct osmo_sccp_instance is private. Provide public API to set
this limit from C.

Change-Id: If3d22a0f65a7ed0be043027652402b32c356e322
2023-05-10 02:00:25 +02:00
Neels Hofmeyr a0fbeeb4d2 SCCP: implement variable limit on Optional Data (CR,CC,CREF,RLSD)
When the Optional Data surpasses 130 bytes, it is not sent as part of
SCCP CR, CC, CREF or RLSD messages, but gets sent separately in a Data
Form 1.

Make this 130 user configurable. This is specified to be 130 bytes
exactly, but to interop with non-conforming peers, make this limit
adjustable per cs7 instance, via osmo_sccp_vty_init().

Add and test new VTY config:

	cs7 instance N
	 sccp max-optional-data (<0-999999>|standard)

Related: ITU-T Q.713 4.2 to 4.5
Related: Ia68dad973ef18513b52f5accb5264c557c7295ea osmo-ttcn3-hacks
Related: SYS#6423
Change-Id: If35697234796af8943691b2de62218e7dc93a08c
2023-04-24 18:45:37 +02:00
Harald Welte 460ba631b5 ASPAC/ASPIA: Don't add routing context IE in ASP-role if routing context 0
If there is only one routing key (and hence routing context, and hence
AS) within one ASP, *and* the routing context is configured as 0 (zero),
we should not include the routing context IE.  This is the way how
libosmo-sigtran has always been special-casing routing context 0 meaning
"routing context is not used".  However, that was only working in SG
role (typical STP use case).  When operating in ASP role, the
special-case handling was missing, causing a routing context IE
containing zero to be included in the related transmitted M3UA ASPAC
and ASPIA messages.

Change-Id: I5ce89b393a3b950ab7fd1eace9038718c9efcc51
Closes: OS#6003
2023-04-15 20:34:33 +08:00
Harald Welte a54c714df3 cosmetic: Fix log message in routing table add error case
* crate -> create (typo)
* linkset -> AS (we're adding a route for an AS here, not a linkset)

Change-Id: I901aa68f64de3bee1766c356a1403b6ca57d5237
2023-04-15 01:35:21 +08:00
Neels Hofmeyr 078622128a add two value_string[]s related to N-PCSTATE
Related: SYS#6319
Change-Id: I873ea30e8f64280487769668c748c67ce4ff4023
2023-04-05 02:30:59 +02:00
Neels Hofmeyr 2e476c692b fix sccp_scoc state S_WAIT_CONN_CONF out_state_mask
In sccp_scoc_states, allow the state transitions present in
S_WAIT_CONN_CONF's event handler function scoc_fsm_wait_conn_conf(), and
thus fix handling of N-DISCONNECT while waiting for SCCP Conn Confirm.

Fixes this error:

 DLSCCP ERROR SCCP-SCOC(1016){WAIT_CONN_CONF}: transition to state IDLE not permitted! (sccp_scoc.c:1213)

S_WAIT_CONN_CONF happens when the caller sends an N-DISCONNECT during
S_CONN_PEND_OUT -- that means, while we are waiting for a CC from the
peer, the caller ends the conn. SCCP-SCOC still waits for the CC first.

When S_WAIT_CONN_CONF expires, the intended path is state change to
S_IDLE, which then deallocates the connection. Allow this state
transition from S_WAIT_CONN_CONF to S_IDLE.

When S_WAIT_CONN_CONF receives a CC, the intended path is to send a
RELRE and state change to S_DISCONN_PEND. Allow this state transition
from S_WAIT_CONN_CONF to S_DISCONN_PEND.

Change-Id: I8145e53124cabd76bd2cee159ab01306a1afaa27
2023-03-24 03:26:42 +01:00
Pau Espin 1e288b9614 sccp: Introduce APIs to get/set osmo_sccp_instance priv data pointer
The field already exists in the struct, but it's not really used
anywhere internally yet (and was not available externally).
Let's make it available to users of the API, similar to osmo_sccp_user_{get,set}_priv().
This way apps can easily store per-sccp-instance state.

Change-Id: I5643e6b14590b1478b3c8dabc8a7a619f5505409
2023-03-13 11:20:31 +01:00
Pau Espin 253c45307e Implement sccp_instance->connections as rbtree
As a result we move from:
INSERT=O(1) SEARCH=O(n) REMOVE=O(1)

to:
INSERT=O(log(N)) SEARCH=O(log(N)) REMOVE=O(log(N))

So we get rid of O(n) complexity every time we need to find a conn
object based on conn_id. When a big number of SCCP conns is handled,
this saves a lot of CPU time every time a conn needs to be looked up,
for instance each time a message is received.
For instance, given 1500 SCCP conns, searching is ~10 steps while it
took 1500 steps beforehand.

Morever, since when creating a new conn_id the code looks if it exists
prior to it, that means in practice inserting used to took O(n), while
now it takes O(log(N)).

Change-Id: I28ac67038207e2fad89ea291629cec5b2f912461
2023-03-10 17:56:42 +01:00
Pau Espin d66c70208f sccp_scpc.c: Simplify conn_create()
Drop local variable with no real use, dereference sccp_instance pointer
once instead of potentially thousands of times.

Change-Id: Iee333fb38d7a37877c37c1de9719a6b67d9e8ed3
2023-03-10 16:25:38 +01:00
Pau Espin f031be9141 Avoid allocating conn_id 0x00FFFFFF
The 0x00FFFFFF source local reference is reserved in M3UA/SCCP, hence
avoid allocating a conn_id with that value since later on when reused as
a source local reference it would fail to be encoded.

Change-Id: Ifcf710ef6024286a1cc3473d6ea3f858552b9926
2023-03-10 16:21:30 +01:00
Vadim Yanitskiy 36d3877483 mtp_pcap: remove unused static_assert() macro definition
Change-Id: Ib0419a2de3aa09a2e1fba1fc2628f12295d83bda
2023-02-24 18:16:00 +07:00
Neels Hofmeyr f9b0746d7d fixup for: add osmo_scu_prim_name_c() / _buf()
I would like to tweak the names for the recently added functions, so
that they are more clear -- quickly before we release it or anyone uses
these.

Depends: libosmocore I9f43428af654a5674ac3035fe4db1394aac7a7af
Related: I4c1998fd7fee7282d107846dae2cff4b5ceb3a7b
Change-Id: If381f537ab91af1feef7f0e51921217f27e18e6a
2023-02-22 16:02:51 +01:00
Max 6e8241356b SS7: do not attempt transfer if AS is down
The attempt to route message via AS which is down will fail anyway:
let's make it explicit.

Add osmo_ss7_as_down() and use it to check AS state before transferring the message.

Change-Id: I0d5f3b6265e7fdaa79e32fbc30f829ef79e7dad1
2023-02-21 08:51:22 +00:00
Neels Hofmeyr 4c761ba304 add osmo_scu_prim_name_c() / _buf()
Add non-legacy string functions for osmo_scu_prim_name in the form of
_buf() and _c() signatures.

So far there is only osmo_scu_prim_name() using a static buffer.
Implement that using osmo_scu_prim_name_buf().

Change-Id: I4c1998fd7fee7282d107846dae2cff4b5ceb3a7b
2023-02-18 02:45:14 +01:00
Neels Hofmeyr ed4e7dbf86 sccp_scmg: ignore PCSTATE.indication
Silence the error log for PCSTATE.indication prims.

When running the HNBGW_Tests.ttcn suite, the osmo-hnbgw LOGL_ERROR is
spammed with messages like:

 DLSCCP ERROR unsupported SCCP user primitive N-PCSTATE.indication (sccp_scmg.c:298)

Add this prim to scmg_prim_cb() to just log on DEBUG that it is ignored.

Related: OS#5679
Change-Id: I5fd38afea94f48ed2f2fcd2d9baa8ec22a571b6b
2023-02-18 02:45:14 +01:00
Pau Espin dc9713a672 Bump version: 1.6.0.20-8b67-dirty → 1.7.0
Change-Id: I431dc58d5c4adfcb2c4ff19a95b31853618034b5
2023-02-07 14:37:23 +01:00
Harald Welte 8b671b073f cosmetic: fix typo in comment
Change-Id: I2e2b5ec36da9b50dcf13a0d7f497a9ca16e6a7a3
2022-12-10 12:52:58 +01:00
Harald Welte 99b912f94a SCOC: dump SUA header when logging "mismatching remote pc"
Provide some more information in the logs when this happens

Change-Id: Idd889b57e8f842e22e5ed54bea0821dcec0cd8ce
2022-12-10 12:51:47 +01:00
Pau Espin 2f648b2daf sccp: Validate local references > 0x00fffffe are not used
SUA allows references of 4 bytes, but SCCP/M3UA doesn't.

SUA: RFC3868 sec 3.10.4:
      The source reference number is a 4 octet long integer.
      This isallocated by the source SUA instance.
M3UA/SCCP: ITU-T Q.713 sec 3.3:
      The "source local reference" parameter field is a three-octet field containing a reference number
      which is generated and used by the local node to identify the connection section after the connection
      section is set up.
      The coding "all ones" is reserved for future use.

Related: SYS#6211
Change-Id: Ia547346bdae54a032d2198ecd4972fb3f8dd073e
2022-11-23 18:11:58 +01:00
Max e5d615efdc SIGTRAN: cache Optional Data for SCCP CR/CC/RLSD
The length limit of optional Data parameter is 130 bytes according to ITU-T Rec Q.713 §4.2..§4.5. If we receive CR, CC or
RLSD message with bigger data - cache it if necessary and send via separate DT1 message after connection becomes active.

Fixes: OS#5579
Change-Id: I0033faf9da393418930252233ce74d62cd1cef8a
2022-09-07 17:36:30 +07:00