Update ebpf/aya-ebpf/src/lib.rs

Co-authored-by: Michal R <vad.sol@proton.me>
reviewable/pr1344/r9
Aurélien DEROIDE 3 weeks ago committed by GitHub
parent e5e5998260
commit 0812d52618
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -114,9 +114,13 @@ mod intrinsics {
}
}
// A reimplementation of the BPF_F_ADJ_ROOM_ENCAP_L2(len) macro of the kernel, to use to construct
// flags to pass to bpf_skb_adjust_room.
// https://elixir.bootlin.com/linux/v6.16.4/source/include/uapi/linux/bpf.h#L6149
/// Builds a flag for [`SkBuffContext::adjust_room`] that defines L2 encapsulation,
/// using `len` as the inner MAC header length.
///
/// Equivalent to the [`BPF_F_ADJ_ROOM_ENCAP_L2`][uapi-bpf-adj-room-encap-l2] macro
/// in the Linux user-space API.
///
/// [uapi-bpf-adj-room-encap-l2]: https://elixir.bootlin.com/linux/v6.16.4/source/include/uapi/linux/bpf.h#L6149
#[inline(always)]
#[allow(non_snake_case)]
pub fn BPF_F_ADJ_ROOM_ENCAP_L2(len: u64) -> u64 {

Loading…
Cancel
Save