Project

General

Profile

Actions

Bug #6279

closed

stream_cli fails to connect when using SCTP if no local address is set

Added by laforge 5 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
Start date:
11/29/2023
Due date:
% Done:

90%

Spec Reference:

Description

In the context of developing osmo_io/io_uring SCTP support, I was trying to build a simple test case, and remembered the stream-server/stream-client programs of libosmo-netif.

Those tools are made for TCP, but one can of course add simple calls to osmo_stream_*_set_proto(foo, IPPROTO_SCTP). For the server that appears to work, but for the client it doesn't: osmo_stream_cli_open returns -22/EINVAL.

I've tracked this down to the difference in setting up the socket:osmo_sock_init2_multiaddr2 (SCTP) vs osmo_sock_init2 (TCP).

It seems that the multiaddr variant fails with -EINVAL if the BIND flag is set and no single local address is given, while the regular variant osmo_sock_init2 succeeds. Is this an intentional difference?

I would expect the BIND flag to behave like usual if no local address is provided: Bind to INADDR_ANY/IN6ADDR_ANY.

Slightly unrlated: One could also argue why does libosmo-netif stream client set the BIND flag if it doesn't really want to bind to a non-specific address? Well, it could want to bind to a specific local port.


Related issues

Related to libosmo-netif - Feature #5753: io_uring support in libosmo-netifResolvedHoernchen11/09/2022

Actions
Related to OsmoSTP - Bug #5186: local-ip config parameter can cause unclear behaviour on dual IP stack systemResolvedpespin06/18/2021

Actions
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)