From: Justin Pettit Date: Tue, 5 Dec 2017 07:22:40 +0000 (-0800) Subject: datapath-windows: Correct endianness for deleting zone. X-Git-Tag: v2.12.3~2386 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=159cc1f4e55252b8d59e41eafb10518d226d914b;p=mirror_ovs.git datapath-windows: Correct endianness for deleting zone. 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 Acked-by: Sairam Venugopal --- diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c index 3203411a8..edc0ec9c5 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 1f0b91210..e5a5fc118 100644 --- a/lib/netlink-conntrack.c +++ b/lib/netlink-conntrack.c @@ -275,7 +275,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);