[ovs-dev] [PATCH v5 11/11] Windows: Ignore the dpif conversions for windows in netlink-conntrack.c

Sairam Venugopal vsairam at vmware.com
Fri Jul 1 20:49:35 UTC 2016


The flags and state sent by Windows datapath are currently in the
userspace format. So prevent further translation.

Signed-off-by: Sairam Venugopal <vsairam at vmware.com>
Acked-by: Nithin Raju <nithin at vmware.com>
---
 lib/netlink-conntrack.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/netlink-conntrack.c b/lib/netlink-conntrack.c
index ad9f0b7..5132bf2 100644
--- a/lib/netlink-conntrack.c
+++ b/lib/netlink-conntrack.c
@@ -525,6 +525,10 @@ nl_ct_parse_tuple(struct nlattr *nla, struct ct_dpif_tuple *tuple,
 static uint8_t
 nl_ct_tcp_state_to_dpif(uint8_t state)
 {
+#ifdef _WIN32
+    /* Windows currently sends up CT_DPIF_TCP state */
+    return state;
+#else
     switch (state) {
     case TCP_CONNTRACK_NONE:
         return CT_DPIF_TCPS_CLOSED;
@@ -549,17 +553,23 @@ nl_ct_tcp_state_to_dpif(uint8_t state)
     default:
         return CT_DPIF_TCPS_CLOSED;
     }
+#endif
 }
 
 static uint8_t
 ip_ct_tcp_flags_to_dpif(uint8_t flags)
 {
+#ifdef _WIN32
+    /* Windows currently sends up CT_DPIF_TCP flags */
+    return flags;
+#else
     uint8_t ret = 0;
 #define CT_DPIF_TCP_FLAG(FLAG) \
         ret |= (flags & IP_CT_TCP_FLAG_##FLAG) ? CT_DPIF_TCPF_##FLAG : 0;
     CT_DPIF_TCP_FLAGS
 #undef CT_DPIF_STATUS_FLAG
     return ret;
+#endif
 }
 
 static bool
-- 
2.5.0.windows.1




More information about the dev mailing list