Skip to content

Commit 08cd1c3

Browse files
author
Xin Long
committed
openvswitch: get related ct labels from its master if it is not confirmed
JIRA: https://issues.redhat.com/browse/RHEL-44560 Tested: compile only commit a23ac97 Author: Xin Long <lucien.xin@gmail.com> Date: Wed Jun 19 18:08:56 2024 -0400 openvswitch: get related ct labels from its master if it is not confirmed Ilya found a failure in running check-kernel tests with at_groups=144 (144: conntrack - FTP SNAT orig tuple) in OVS repo. After his further investigation, the root cause is that the labels sent to userspace for related ct are incorrect. The labels for unconfirmed related ct should use its master's labels. However, the changes made in commit 8c8b733 ("openvswitch: set IPS_CONFIRMED in tmpl status only when commit is set in conntrack") led to getting labels from this related ct. So fix it in ovs_ct_get_labels() by changing to copy labels from its master ct if it is a unconfirmed related ct. Note that there is no fix needed for ct->mark, as it was already copied from its master ct for related ct in init_conntrack(). Fixes: 8c8b733 ("openvswitch: set IPS_CONFIRMED in tmpl status only when commit is set in conntrack") Reported-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Xin Long <lucien.xin@gmail.com> Reviewed-by: Ilya Maximets <i.maximets@ovn.org> Tested-by: Ilya Maximets <i.maximets@ovn.org> Reviewed-by: Aaron Conole <aconole@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Xin Long <lxin@redhat.com>
1 parent dc79087 commit 08cd1c3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/openvswitch/conntrack.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,13 @@ static u32 ovs_ct_get_mark(const struct nf_conn *ct)
167167
static void ovs_ct_get_labels(const struct nf_conn *ct,
168168
struct ovs_key_ct_labels *labels)
169169
{
170-
struct nf_conn_labels *cl = ct ? nf_ct_labels_find(ct) : NULL;
170+
struct nf_conn_labels *cl = NULL;
171171

172+
if (ct) {
173+
if (ct->master && !nf_ct_is_confirmed(ct))
174+
ct = ct->master;
175+
cl = nf_ct_labels_find(ct);
176+
}
172177
if (cl)
173178
memcpy(labels, cl->bits, OVS_CT_LABELS_LEN);
174179
else

0 commit comments

Comments
 (0)