From: Jarno Rajahalme <ja...@ovn.org>

Older kernels have variable sized labels, and the struct itself
contains only the length, so we must memcpy the bits explicitly.

The modified system test fails on older kernels without this change.

[Committer Notes]
Dropped system-traffic changes as they modify a test not on branch-2.7.

VMware-BZ: #1841876
Fixes: 09aa98ad496d ("datapath: Inherit master's labels.")
Signed-off-by: Jarno Rajahalme <ja...@ovn.org>
Acked-by: Andy Zhou <az...@ovn.org>
---
 datapath/conntrack.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/datapath/conntrack.c b/datapath/conntrack.c
index 87306a2c5e07..392be25cdb6d 100644
--- a/datapath/conntrack.c
+++ b/datapath/conntrack.c
@@ -290,9 +290,12 @@ static int ovs_ct_init_labels(struct nf_conn *ct, struct 
sw_flow_key *key,
        if (!cl)
                return -ENOSPC;
 
-       /* Inherit the master's labels, if any. */
+       /* Inherit the master's labels, if any.  Must use memcpy for backport
+        * as struct assignment only copies the length field in older
+        * kernels.
+        */
        if (master_cl)
-               *cl = *master_cl;
+               memcpy(cl->bits, master_cl->bits, OVS_CT_LABELS_LEN);
 
        if (have_mask) {
                u32 *dst = (u32 *)cl->bits;
-- 
2.11.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to