diff mbox series

[ovs-dev,v1] datapath-windows: Fix updating ct label when mask is specified

Message ID 20190815163906.4776-1-kumaranand@vmware.com
State Accepted
Delegated to: Alin Gabriel Serdean
Headers show
Series [ovs-dev,v1] datapath-windows: Fix updating ct label when mask is specified | expand

Commit Message

patchwork-bot+netdevbpf--- via dev Aug. 15, 2019, 4:39 p.m. UTC
From: kumaranand <kumaranand@vmware.com>

When an existing label needs to be changed by specifing bits to be
updated using mask, instead of updating only the masked bits,
new label was getting overridden. This patch fixes this issue.

Signed-off-by: Anand Kumar <kumaranand@vmware.com>
---
 datapath-windows/ovsext/Conntrack.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Alin Serdean Aug. 18, 2019, 10:27 p.m. UTC | #1
Thanks a lot for the patch!

I applied it on master and backported as far as I could.

Alin.

> On 15 Aug 2019, at 19:39, Anand Kumar via dev <ovs-dev@openvswitch.org> wrote:
> 
> From: kumaranand <kumaranand@vmware.com>
> 
> When an existing label needs to be changed by specifing bits to be
> updated using mask, instead of updating only the masked bits,
> new label was getting overridden. This patch fixes this issue.
> 
> Signed-off-by: Anand Kumar <kumaranand@vmware.com>
> ---
> datapath-windows/ovsext/Conntrack.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c
> index bc00b60..ba56116 100644
> --- a/datapath-windows/ovsext/Conntrack.c
> +++ b/datapath-windows/ovsext/Conntrack.c
> @@ -807,6 +807,7 @@ OvsConntrackSetLabels(OvsFlowKey *key,
>     ovs_u128 v, m, pktMdLabel = {0};
>     memcpy(&v, val, sizeof v);
>     memcpy(&m, mask, sizeof m);
> +    memcpy(&pktMdLabel, &entry->labels, sizeof(struct ovs_key_ct_labels));
> 
>     pktMdLabel.u64.lo = v.u64.lo | (pktMdLabel.u64.lo & ~(m.u64.lo));
>     pktMdLabel.u64.hi = v.u64.hi | (pktMdLabel.u64.hi & ~(m.u64.hi));
> -- 
> 2.9.3.windows.1
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox series

Patch

diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c
index bc00b60..ba56116 100644
--- a/datapath-windows/ovsext/Conntrack.c
+++ b/datapath-windows/ovsext/Conntrack.c
@@ -807,6 +807,7 @@  OvsConntrackSetLabels(OvsFlowKey *key,
     ovs_u128 v, m, pktMdLabel = {0};
     memcpy(&v, val, sizeof v);
     memcpy(&m, mask, sizeof m);
+    memcpy(&pktMdLabel, &entry->labels, sizeof(struct ovs_key_ct_labels));
 
     pktMdLabel.u64.lo = v.u64.lo | (pktMdLabel.u64.lo & ~(m.u64.lo));
     pktMdLabel.u64.hi = v.u64.hi | (pktMdLabel.u64.hi & ~(m.u64.hi));