Skip to content

Commit

Permalink
cf-socket: removing the empty switch from the source.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michał Antoniak committed Mar 4, 2025
1 parent 6758aa7 commit 24e7b60
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/cf-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1843,16 +1843,17 @@ static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf,
* non-blocking socket created by cf_socket_open() to it. Thus, we
* do not need to call curlx_nonblock() in cf_udp_setup_quic() anymore.
*/
#ifdef __linux__
switch(ctx->addr.family) {
#if defined(__linux__) && defined(IP_MTU_DISCOVER)
#ifdef IP_MTU_DISCOVER
case AF_INET: {
int val = IP_PMTUDISC_DO;
(void)setsockopt(ctx->sock, IPPROTO_IP, IP_MTU_DISCOVER, &val,
sizeof(val));
break;
}
#endif
#if defined(__linux__) && defined(IPV6_MTU_DISCOVER)
#ifdef IPV6_MTU_DISCOVER
case AF_INET6: {
int val = IPV6_PMTUDISC_DO;
(void)setsockopt(ctx->sock, IPPROTO_IPV6, IPV6_MTU_DISCOVER, &val,
Expand All @@ -1862,11 +1863,12 @@ static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf,
#endif
}

#if defined(__linux__) && defined(UDP_GRO) && \
#if defined(UDP_GRO) && \
(defined(HAVE_SENDMMSG) || defined(HAVE_SENDMSG)) && \
((defined(USE_NGTCP2) && defined(USE_NGHTTP3)) || defined(USE_QUICHE))
(void)setsockopt(ctx->sock, IPPROTO_UDP, UDP_GRO, &one,
(socklen_t)sizeof(one));
#endif
#endif

return CURLE_OK;
Expand Down

0 comments on commit 24e7b60

Please sign in to comment.