Skip to content

Commit a23ac97

Browse files
lxindavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Xin Long <[email protected]> Reviewed-by: Ilya Maximets <[email protected]> Tested-by: Ilya Maximets <[email protected]> Reviewed-by: Aaron Conole <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ad53f5f commit a23ac97

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/openvswitch/conntrack.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,13 @@ static u32 ovs_ct_get_mark(const struct nf_conn *ct)
168168
static void ovs_ct_get_labels(const struct nf_conn *ct,
169169
struct ovs_key_ct_labels *labels)
170170
{
171-
struct nf_conn_labels *cl = ct ? nf_ct_labels_find(ct) : NULL;
171+
struct nf_conn_labels *cl = NULL;
172172

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

0 commit comments

Comments
 (0)