]> git.proxmox.com Git - mirror_ovs.git/commitdiff
datapath-windows: Correct endianness for deleting zone.
authorJustin Pettit <jpettit@ovn.org>
Tue, 5 Dec 2017 07:22:40 +0000 (23:22 -0800)
committerJustin Pettit <jpettit@ovn.org>
Thu, 7 Dec 2017 23:06:00 +0000 (15:06 -0800)
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@ovn.org>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
datapath-windows/ovsext/Conntrack.c
lib/netlink-conntrack.c

index 3203411a8b7adfabcefd3ed4dd6d642ea46d8f04..edc0ec9c53243ba823474df3606e011170ade8d4 100644 (file)
@@ -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);
index 1f0b9121036d9e067c2261315ab5320116a5555f..e5a5fc1181222998f4c848913d9a978ea5389daf 100644 (file)
@@ -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);