________________________________________
From: [email protected] <[email protected]> on
behalf of Alin Serdean <[email protected]>
Sent: Thursday, July 13, 2017 9:40 PM
To: [email protected]
Subject: [ovs-dev] [PATCH 35/40] datapath-windows: Treat TCP_HDR_LEN static
analysis warnings
Using the shift operator in macros makes the static analyzer on WDK 8.1
confused.
Switch to multiplication when trying to get the data offset of the TCP header.
Signed-off-by: Alin Gabriel Serdean <[email protected]>
---
datapath-windows/ovsext/NetProto.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/datapath-windows/ovsext/NetProto.h
b/datapath-windows/ovsext/NetProto.h
index 92d6611..9a17dee 100644
--- a/datapath-windows/ovsext/NetProto.h
+++ b/datapath-windows/ovsext/NetProto.h
@@ -68,7 +68,7 @@ typedef UINT64 IP4FragUnitLength;
// length UINT for ipv6 header length.
typedef UINT64 IP6UnitLength;
-#define TCP_HDR_LEN(tcph) IP4_UNITS_TO_BYTES((tcph)->doff)
+#define TCP_HDR_LEN(tcph) ((tcph)->doff * 4)
#define TCP_DATA_LENGTH(iph, tcph) (ntohs(iph->tot_len) - \
IP4_HDR_LEN(iph) - TCP_HDR_LEN(tcph))
--
2.10.2.windows.1
_______________________________________________
Acked-by: Shashank Ram <[email protected]>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev