When programs need to calculate the csum from scratch for small UDP packets and use bpf_l4_csum_replace() to feed the result from helpers like bpf_csum_diff(), then we need a flag besides BPF_F_MARK_MANGLED_0 that would ignore the case of current csum being 0, and which would still allow for the helper to set the csum and transform when needed to CSUM_MANGLED_0.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -522,6 +522,7 @@ enum bpf_func_id { · 521 unmodified lines | |||
| 522 | /* BPF_FUNC_l4_csum_replace flags. */ | 522 | /* BPF_FUNC_l4_csum_replace flags. */ |
| 523 | #define BPF_F_PSEUDO_HDR (1ULL << 4) | 523 | #define BPF_F_PSEUDO_HDR (1ULL << 4) |
| 524 | #define BPF_F_MARK_MANGLED_0 (1ULL << 5) | 524 | #define BPF_F_MARK_MANGLED_0 (1ULL << 5) |
| 525 | #define BPF_F_MARK_ENFORCE (1ULL << 6) | ||
| 525 | 526 | ||
| 526 | /* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */ | 527 | /* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */ |
| 527 | #define BPF_F_INGRESS (1ULL << 0) | 528 | #define BPF_F_INGRESS (1ULL << 0) |