diff mbox

[ovs-dev,35/40] datapath-windows: Treat TCP_HDR_LEN static analysis warnings

Message ID 20170714044033.15196-36-aserdean@cloudbasesolutions.com
State Accepted
Headers show

Commit Message

Alin Serdean July 14, 2017, 4:40 a.m. UTC
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 <aserdean@cloudbasesolutions.com>
---
 datapath-windows/ovsext/NetProto.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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))