@@ -159,9 +159,9 @@ public struct UDPProtocol: NetworkProtocol {
159159 if self . maximumDatagramSize > UDPProtocol . headerLength {
160160 self . maximumDatagramSize -= UDPProtocol . headerLength
161161 }
162- let udpCsumOffload : UInt32 = path. hardwareChecksumFlags
163- if isIPv4 && ( ( udpCsumOffload & InterfaceChecksumFlags . csumUDP . rawValue) != 0 )
164- || !isIPv4 && ( ( udpCsumOffload & InterfaceChecksumFlags . csumUDPIPV6 . rawValue) != 0 )
162+ let udpChecksumOffload : UInt32 = path. hardwareChecksumFlags
163+ if isIPv4 && ( ( udpChecksumOffload & InterfaceChecksumFlags . csumUDPIPv4 . rawValue) != 0 )
164+ || !isIPv4 && ( ( udpChecksumOffload & InterfaceChecksumFlags . csumUDPIPv6 . rawValue) != 0 )
165165 {
166166 self . flags. insert ( . fullChecksumOffload)
167167 self . flags. remove ( . partialChecksumOffload)
@@ -218,6 +218,7 @@ public struct UDPProtocol: NetworkProtocol {
218218 if udpOptions. fullChecksumOffload {
219219 self . flags. insert ( . fullChecksumOffload)
220220 }
221+ #if !NETWORK_EMBEDDED
221222 if let transport = parameters. defaultStack. transport {
222223 if transport. options == udpOptions, udpOptions. useQUICStats {
223224 self . flags. insert ( . upperTransportIsQUIC)
@@ -228,6 +229,7 @@ public struct UDPProtocol: NetworkProtocol {
228229 self . flags. insert ( . upperTransportIsQUIC)
229230 }
230231 }
232+ #endif
231233 }
232234 }
233235
@@ -436,8 +438,8 @@ public struct UDPProtocol: NetworkProtocol {
436438 if self . flags. contains ( . fullChecksumOffload) {
437439 let csumFlags : ChecksumFlags =
438440 isIPv4
439- ? [ . udpv4 , . zeroInvert]
440- : [ . udpv6 , . zeroInvert]
441+ ? [ . udpIPv4 , . zeroInvert]
442+ : [ . udpIPv6 , . zeroInvert]
441443 frame. checksumOffloadFlags |= csumFlags. rawValue
442444 }
443445
0 commit comments