From 29f23e161ed66549cceaaa76f35af7ec7eb2c9e8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 10 Jan 2019 14:28:16 +0100 Subject: [PATCH] Fix socket type to IPv4 in case of no-multi usage sctp_create_new_listener() takes a parameter server_type which is NOT the IP version but whether it is an SCTP multihoming server. There was a bug that when multihoming is not wanted, it created an IPv6 socket instead of IPv4. This commit fixes this. IPv6 is not supported yet. --- openair3/SCTP/sctp_eNB_task.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index ff54c47255..4a44dfa2cf 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -745,7 +745,7 @@ static int sctp_create_new_listener( } } else { - if ((sd = socket(AF_INET6, SOCK_STREAM, IPPROTO_SCTP)) < 0) { + if ((sd = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP)) < 0) { SCTP_ERROR("socket: %s:%d\n", strerror(errno), errno); return -1; }