diff mbox

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

Message ID 1467245333-8112-12-git-send-email-vsairam@vmware.com
State Superseded
Delegated to: Guru Shetty
Headers show

Commit Message

Sairam Venugopal June 30, 2016, 12:08 a.m. UTC
The flags and state sent by Windows datapath are currently in the
userspace format. So prevent further translation.

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

Comments

Nithin Raju July 1, 2016, 2:30 a.m. UTC | #1
>
>+    /* Windows currently sends down CT_DPIF_TCP state */

³sends up² would probably be more appropriate :)

>static uint8_t
> ip_ct_tcp_flags_to_dpif(uint8_t flags)
> {
>+#ifdef _WIN32
>+    /* Windows currently sends down CT_DPIF_TCP flags */

³sends up² would probably be more appropriate :)


Looks good otherwise.

Acked-by: Nithin Raju <nithin@vmware.com>
diff mbox

Patch

diff --git a/lib/netlink-conntrack.c b/lib/netlink-conntrack.c
index 329d446..e8cd242 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 down 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 down 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