Project

General

Profile

Actions

Bug #3383

closed

libosmo-sigtran performs blocking connect() for M3UA

Added by laforge over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
Start date:
07/05/2018
Due date:
% Done:

100%

Spec Reference:

Description

When trying to establish a connection from OsmoBSC to a MSC, and the MSC/STP doesn't either
a) actively refuse the connection (port unreachable or the like), or
b) accept the connection

We are blocking the entire BSC process, so no vty or Abis processing is happening.

it basically looks like this in strace:

bind(8, {sa_family=AF_INET, sin_port=htons(30003), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
connect(8, {sa_family=AF_INET, sin_port=htons(30003), sin_addr=inet_addr("12.13.14.15")}, 16^Cstrace: Process 56640 detached
 <detached ...>

Actions #1

Updated by laforge over 5 years ago

  • Status changed from New to In Progress
  • Assignee set to laforge
  • % Done changed from 0 to 10

libosmo-sigtran is using osmo_stream_cli* API of libosmo-netif in order to perform the client side connection to an STP.

In the end, osmo_stream_cli_open2 is called, which will
  • first call osmo_sock_init2(AF_INET, SOCK_STREAM, ... OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND)
  • later (if cli->flags & OSMO_STREAM_CLI_F_NODELAY) setsockopt_nodelay()

At no point we seem to be setting FIONBIO / non-blocking on that socket. libosmocore can do this if OSMO_SOCK_F_NONBLOCK is set - which libosmo-netif doesn't do.

Actions #2

Updated by laforge over 5 years ago

  • % Done changed from 10 to 50
Actions #3

Updated by laforge over 5 years ago

  • % Done changed from 50 to 90

I just did a quick test using LD_PRELOAD of the modified libosmo-netif, and indeed the OsmoBSC is now using non-blcoking connect. After about 5 minutes, the non-blocking connect fails and the re-connect logic of libosmo-netif kicks in. looks good so far.

Actions #4

Updated by laforge over 5 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

patch merged

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)