Skip to content

Commit

Permalink
datapath-windows: Correct endianness for deleting zone.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
justinpettit committed Dec 7, 2017
1 parent c43a133 commit 159cc1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion datapath-windows/ovsext/Conntrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/netlink-conntrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 159cc1f

Please sign in to comment.