Commit 5313b0d
bpf: clear mark content before storing the cluster ID
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>1 parent f3732f5 commit 5313b0d
2 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
| 163 | + | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| |||
232 | 235 | | |
233 | 236 | | |
234 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
235 | 243 | | |
236 | 244 | | |
237 | 245 | | |
| |||
0 commit comments