Commit Graph

4 Commits

Author SHA1 Message Date
Harald Welte 485a1be9d8 Fix SCCP client crash on xUA server (STP) disconnect
When the server (STP) disappears from a live SCCP client,
then the xUA default layer manager receives LM_E_SCTP_DISC_IND,
which is traversing retart_asp().  In there, we first terminate
the current instance of the layer manager FSM, and then re-initialize
the ASP to use the default layer manager using
osmo_ss7_asp_use_default_lm().

However, osmo_ss7_asp_use_default_lm() uses the presence of an
asp->lm_priv pointer as a sign that the old layer manager is still
running and attempts to terminate it - despite being terminated
just before in restart_as().

So let's simply remove the termination from restart_asp(), and
leave it to osmo_ss7_asp_use_default_lm().

Fixes: OS#2402
Change-Id: I062d3af17539de864b56d079fe9b8d76ad99cf1e
2017-08-15 23:30:10 +02:00
Philipp Maier dcb360a9db xua: fix possible memory leak in seems osmo_ss7_asp_use_default_lm()
The function seems osmo_ss7_asp_use_default_lm() does not guard
against an asp->lm_priv FSM instance already existing. If this
function is called a second time, it will overwrite asp->lm_priv,
causing the original fsm instance to leaked.

Check if asp->lm_priv already exists and terminate (free) the
FSM if present.

Change-Id: I4ad435c042a435c4e641c6e5c53b91265dd23d40
2017-07-22 09:08:13 +00:00
Harald Welte 68e9aaa32d xua_default_lm_fsm: Missing printf() argument
Change-Id: I03c30a0d1e03ff56df80bdd1e8a7846142b6f79c
Fixes: coverity CID#166993
2017-04-27 10:27:35 +02:00
Harald Welte ed15c74a01 Add a default layer manager using RKM to register PC with SG
This "default layer manager" can optionally be used by a xUA ASP. It
will handle the xUA Layer Manager (xlm) primitives and use them to
behave as follows:

* bring the ASP into state "INACTIVE"
* see if the SG can match our connection (based on IP address + port
  information) to a statically configured ASP configuration with
  associated AS(s).  If yes, it will send us a NOTIFY message with
  AS-INACTIVE.
* if the above doesn't work, try to dynamically register a routing key
  using RKM for the point code that was locally confiured on the
  ASP/client.   If that works, the SG will now have created ASP and AS
  objects as well as a routing key and be able to serve us, sending the
  NOTIFY with the AS-INACTIVE state.
* After either of the two above, we will attempt to transition into
  ASP-ACTIVE.  The SG should send us an AS-ACTIVE notification in return
* if anything fails, abort and disconnect the SCTP connection, restart
  related FSMs and start from scratch

Change-Id: I78d4623dd213b5c59007a026a6cc3cfe5c04af50
2017-04-13 18:05:13 +02:00