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.
This commit is contained in:
Robert Schmidt
2019-01-10 14:28:25 +01:00
parent e389b79818
commit 29f23e161e
+1 -1
View File
@@ -745,7 +745,7 @@ static int sctp_create_new_listener(
} }
} }
else { 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); SCTP_ERROR("socket: %s:%d\n", strerror(errno), errno);
return -1; return -1;
} }