[ovs-dev] [PATCH] datapath-windows: Correct endianness for deleting zone.

Sairam Venugopal vsairam at vmware.com
Thu Dec 7 22:57:34 UTC 2017


Thanks for the patch. Discussed about the patch offline. 

This is required since we have now introduced a newer api for deleting 5-tuples
and this breaks the assumption of zone-id not being in the right byte order.

Acked-by: Sairam Venugopal <vsairam at vmware.com>





On 12/4/17, 11:30 PM, "Justin Pettit" <jpettit at ovn.org> wrote:

>The zone Netlink attribute is supposed to be in network-byte order, but
>the Windows code for deleting conntrack entries was treating it as
>host-byte order.
>
>Found by inspection.
>
>Signed-off-by: Justin Pettit <jpettit at ovn.org>
>---
> datapath-windows/ovsext/Conntrack.c | 2 +-
> lib/netlink-conntrack.c             | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c
>index 3203411a8b7a..edc0ec9c5324 100644
>--- a/datapath-windows/ovsext/Conntrack.c
>+++ b/datapath-windows/ovsext/Conntrack.c
>@@ -1076,7 +1076,7 @@ OvsCtDeleteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
>     }
> 
>     if (ctAttrs[CTA_ZONE]) {
>-        zone = NlAttrGetU16(ctAttrs[CTA_ZONE]);
>+        zone = ntohs(NlAttrGetU16(ctAttrs[CTA_ZONE]));
>     }
> 
>     status = OvsCtFlush(zone);
>diff --git a/lib/netlink-conntrack.c b/lib/netlink-conntrack.c
>index 1e1bb2f79d1d..3c651b6c856a 100644
>--- a/lib/netlink-conntrack.c
>+++ b/lib/netlink-conntrack.c
>@@ -251,7 +251,7 @@ nl_ct_flush_zone(uint16_t flush_zone)
> 
>     nl_msg_put_nfgenmsg(&buf, 0, AF_UNSPEC, NFNL_SUBSYS_CTNETLINK,
>                         IPCTNL_MSG_CT_DELETE, NLM_F_REQUEST);
>-    nl_msg_put_be16(&buf, CTA_ZONE, flush_zone);
>+    nl_msg_put_be16(&buf, CTA_ZONE, htons(flush_zone));
> 
>     err = nl_transact(NETLINK_NETFILTER, &buf, NULL);
>     ofpbuf_uninit(&buf);
>-- 
>2.7.4
>


More information about the dev mailing list