bpf: clear mark content before storing the cluster ID#43159
bpf: clear mark content before storing the cluster ID#43159giorio94 merged 1 commit intocilium:mainfrom
Conversation
647bd35 to
a0502cb
Compare
|
/test |
|
MBOI @julianwiedmann |
|
Changes LGTM. Could you apply the following: Currently, it fails when running on the main branch with |
Currently, the ctx_set_cluster_id_mark helper does not clear the mark before storing the cluster ID. However, the resulting value is not correct in case the same portions of the mark did already contain some value. For instance, this can happen if set_identity_mark got called before, which is now the case since 2660242 ("bpf: lxc: always set identity mark on forwarded egressing traffic"). Let's get this fixed by explicitly masking the mark before storing the cluster ID. Rather than wiping out the entire content, we preserve the "magic" part, which is not expected to interfere. Additionally, let's extend the related BPF test to assert that we correctly propagate the destination clusterID to bpf overlay (thanks Martynas). Co-authored-by: Martynas Pumputis <martynas@isovalent.com> Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
a0502cb to
8c9738c
Compare
Added, thanks a lot! |
|
/test |
@giorio94 Looking at |
Thanks a lot for the feedback. I've took a stab at fixing this in #43258. Let me know if that makes sense to you (I don't have much context in this area). |
Currently, the ctx_set_cluster_id_mark helper does not clear the mark before storing the cluster ID. However, the resulting value is not correct in case the same portions of the mark did already contain some value. For instance, this can happen if set_identity_mark got called before, which is now the case since 2660242 ("bpf: lxc: always set identity mark on forwarded egressing traffic").
Let's get this fixed by explicitly masking the mark before storing the cluster ID. Rather than wiping out the entire content, we preserve the "magic" part, which is not expected to interfere.
Set the backport/affect labels coherently with #42551.