Latest update - 9089
This commit is contained in:
@@ -1009,6 +1009,78 @@ ngx_configure_listening_sockets(ngx_cycle_t *cycle)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if (NGX_HAVE_IP_MTU_DISCOVER)
|
||||
|
||||
if (ls[i].quic && ls[i].sockaddr->sa_family == AF_INET) {
|
||||
value = IP_PMTUDISC_DO;
|
||||
|
||||
if (setsockopt(ls[i].fd, IPPROTO_IP, IP_MTU_DISCOVER,
|
||||
(const void *) &value, sizeof(int))
|
||||
== -1)
|
||||
{
|
||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
|
||||
"setsockopt(IP_MTU_DISCOVER) "
|
||||
"for %V failed, ignored",
|
||||
&ls[i].addr_text);
|
||||
}
|
||||
}
|
||||
|
||||
#elif (NGX_HAVE_IP_DONTFRAG)
|
||||
|
||||
if (ls[i].quic && ls[i].sockaddr->sa_family == AF_INET) {
|
||||
value = 1;
|
||||
|
||||
if (setsockopt(ls[i].fd, IPPROTO_IP, IP_DONTFRAG,
|
||||
(const void *) &value, sizeof(int))
|
||||
== -1)
|
||||
{
|
||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
|
||||
"setsockopt(IP_DONTFRAG) "
|
||||
"for %V failed, ignored",
|
||||
&ls[i].addr_text);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if (NGX_HAVE_INET6)
|
||||
|
||||
#if (NGX_HAVE_IPV6_MTU_DISCOVER)
|
||||
|
||||
if (ls[i].quic && ls[i].sockaddr->sa_family == AF_INET6) {
|
||||
value = IPV6_PMTUDISC_DO;
|
||||
|
||||
if (setsockopt(ls[i].fd, IPPROTO_IPV6, IPV6_MTU_DISCOVER,
|
||||
(const void *) &value, sizeof(int))
|
||||
== -1)
|
||||
{
|
||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
|
||||
"setsockopt(IPV6_MTU_DISCOVER) "
|
||||
"for %V failed, ignored",
|
||||
&ls[i].addr_text);
|
||||
}
|
||||
}
|
||||
|
||||
#elif (NGX_HAVE_IP_DONTFRAG)
|
||||
|
||||
if (ls[i].quic && ls[i].sockaddr->sa_family == AF_INET6) {
|
||||
value = 1;
|
||||
|
||||
if (setsockopt(ls[i].fd, IPPROTO_IPV6, IPV6_DONTFRAG,
|
||||
(const void *) &value, sizeof(int))
|
||||
== -1)
|
||||
{
|
||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
|
||||
"setsockopt(IPV6_DONTFRAG) "
|
||||
"for %V failed, ignored",
|
||||
&ls[i].addr_text);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user