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:
parent
c50479d021
commit
9ef5cbee01
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue