From aee8df609b7bc3813f22300baff7dca85ca1bcf6 Mon Sep 17 00:00:00 2001 From: Jack He Date: Fri, 1 Nov 2024 16:10:29 -0700 Subject: [PATCH] fix typo for epoll, add winkernel checks --- src/platform/datapath_epoll.c | 2 +- src/platform/datapath_winkernel.c | 72 ++++++++++++++++--------------- 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/src/platform/datapath_epoll.c b/src/platform/datapath_epoll.c index 7d0c445261..c0c45e5ae5 100644 --- a/src/platform/datapath_epoll.c +++ b/src/platform/datapath_epoll.c @@ -348,7 +348,7 @@ CxPlatDataPathCalculateFeatureSupport( // // TTL should always be available / enabled on Linux. // - Datapath->Features != CXPLAT_DATAPATH_FEATURE_TTL; + Datapath->Features |= CXPLAT_DATAPATH_FEATURE_TTL; } void diff --git a/src/platform/datapath_winkernel.c b/src/platform/datapath_winkernel.c index e5c8520dc9..9099615389 100644 --- a/src/platform/datapath_winkernel.c +++ b/src/platform/datapath_winkernel.c @@ -1692,42 +1692,44 @@ CxPlatSocketCreateUdp( goto Error; } - Option = TRUE; - Status = - CxPlatDataPathSetControlSocket( - Binding, - WskSetOption, - IP_HOPLIMIT, - IPPROTO_IP, - sizeof(Option), - &Option); - if (QUIC_FAILED(Status)) { - QuicTraceEvent( - DatapathErrorStatus, - "[data][%p] ERROR, %u, %s.", - Binding, - Status, - "Set IP_HOPLIMIT"); - goto Error; - } + if (Datapath->Features & CXPLAT_DATAPATH_FEATURE_TTL) { + Option = TRUE; + Status = + CxPlatDataPathSetControlSocket( + Binding, + WskSetOption, + IP_HOPLIMIT, + IPPROTO_IP, + sizeof(Option), + &Option); + if (QUIC_FAILED(Status)) { + QuicTraceEvent( + DatapathErrorStatus, + "[data][%p] ERROR, %u, %s.", + Binding, + Status, + "Set IP_HOPLIMIT"); + goto Error; + } - Option = TRUE; - Status = - CxPlatDataPathSetControlSocket( - Binding, - WskSetOption, - IPV6_HOPLIMIT, - IPPROTO_IPV6, - sizeof(Option), - &Option); - if (QUIC_FAILED(Status)) { - QuicTraceEvent( - DatapathErrorStatus, - "[data][%p] ERROR, %u, %s.", - Binding, - Status, - "Set IPV6_HOPLIMIT"); - goto Error; + Option = TRUE; + Status = + CxPlatDataPathSetControlSocket( + Binding, + WskSetOption, + IPV6_HOPLIMIT, + IPPROTO_IPV6, + sizeof(Option), + &Option); + if (QUIC_FAILED(Status)) { + QuicTraceEvent( + DatapathErrorStatus, + "[data][%p] ERROR, %u, %s.", + Binding, + Status, + "Set IPV6_HOPLIMIT"); + goto Error; + } } if (Datapath->Features & CXPLAT_DATAPATH_FEATURE_RECV_COALESCING) {