aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-08-19 17:48:26 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-08-19 18:15:38 +0200
commitef6ae62c6e6babc6cbd5b1b72fda59c4c857e08b (patch)
tree45a4b37338cdbebe4cb6df516e93bececbd3e392 /src/stream.c
parent22b0fa6326f191102120cf58720cf8bb840ae017 (diff)
stream: Support creating sockets with IPv6 addresses
In the case of SCTP, an association supports now containing both IPv4 and v6 addresses. Depends: libosmocore.git Change-Id I36d8ab85d92bba4d6adb83bc1875eb61094ed2ef Change-Id: Ie6bb17a9af6ca21d5e350f9c9d2d74c97c5a00af
Diffstat (limited to 'src/stream.c')
-rw-r--r--src/stream.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/stream.c b/src/stream.c
index cfe8cfe..e265ee1 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -658,14 +658,14 @@ int osmo_stream_cli_open2(struct osmo_stream_cli *cli, int reconnect)
switch (cli->proto) {
#ifdef HAVE_LIBSCTP
case IPPROTO_SCTP:
- ret = osmo_sock_init2_multiaddr(AF_INET, SOCK_STREAM, cli->proto,
+ ret = osmo_sock_init2_multiaddr(AF_UNSPEC, SOCK_STREAM, cli->proto,
(const char **)cli->local_addr, cli->local_addrcnt, cli->local_port,
(const char **)cli->addr, cli->addrcnt, cli->port,
OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK);
break;
#endif
default:
- ret = osmo_sock_init2(AF_INET, SOCK_STREAM, cli->proto,
+ ret = osmo_sock_init2(AF_UNSPEC, SOCK_STREAM, cli->proto,
cli->local_addr[0], cli->local_port,
cli->addr[0], cli->port,
OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK);
@@ -731,14 +731,14 @@ int osmo_stream_cli_open(struct osmo_stream_cli *cli)
switch (cli->proto) {
#ifdef HAVE_LIBSCTP
case IPPROTO_SCTP:
- ret = osmo_sock_init2_multiaddr(AF_INET, SOCK_STREAM, cli->proto,
+ ret = osmo_sock_init2_multiaddr(AF_UNSPEC, SOCK_STREAM, cli->proto,
(const char **)cli->local_addr, cli->local_addrcnt, cli->local_port,
(const char **)cli->addr, cli->addrcnt, cli->port,
OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK);
break;
#endif
default:
- ret = osmo_sock_init2(AF_INET, SOCK_STREAM, cli->proto,
+ ret = osmo_sock_init2(AF_UNSPEC, SOCK_STREAM, cli->proto,
cli->local_addr[0], cli->local_port,
cli->addr[0], cli->port,
OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK);
@@ -1055,13 +1055,13 @@ int osmo_stream_srv_link_open(struct osmo_stream_srv_link *link)
switch (link->proto) {
#ifdef HAVE_LIBSCTP
case IPPROTO_SCTP:
- ret = osmo_sock_init2_multiaddr(AF_INET, SOCK_STREAM, link->proto,
+ ret = osmo_sock_init2_multiaddr(AF_UNSPEC, SOCK_STREAM, link->proto,
(const char **)link->addr, link->addrcnt, link->port,
NULL, 0, 0, OSMO_SOCK_F_BIND);
break;
#endif
default:
- ret = osmo_sock_init(AF_INET, SOCK_STREAM, link->proto,
+ ret = osmo_sock_init(AF_UNSPEC, SOCK_STREAM, link->proto,
link->addr[0], link->port, OSMO_SOCK_F_BIND);
}
if (ret < 0)