1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

Use IPPROTO_TCP if getprotobyname("tcp") fails.

This commit is contained in:
Kristján Valur Jónsson 2019-10-27 16:29:22 +00:00 committed by Andy Green
parent c50479d021
commit 9ef5cbee01

View file

@ -120,10 +120,10 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd,
tcp_proto = getprotobyname("TCP");
if (!tcp_proto) {
int error = LWS_ERRNO;
lwsl_err("getprotobyname() failed with error %d\n", error);
return 1;
}
protonbr = tcp_proto->p_proto;
lwsl_warn("getprotobyname(\"TCP\") failed with error, falling back to 6 %d\n", error);
protonbr = 6; /* IPPROTO_TCP */
} else
protonbr = tcp_proto->p_proto;
#else
protonbr = 6;
#endif