ebpf: Change `static mut` to `static` in map declaration

Maps are using UnsafeCell for interior mutability, therefore `static
mut` is not needed anymore.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
pull/59/head
Michal Rostecki 2 years ago
parent 12c43b56bf
commit 0c4b89b497

@ -145,7 +145,7 @@ use aya_log_ebpf::info;
use {{crate_name}}_common::SockKey; use {{crate_name}}_common::SockKey;
#[map(name="{{sock_map}}")] #[map(name="{{sock_map}}")]
static mut {{sock_map}}: SockHash<SockKey> = SockHash::<SockKey>::with_max_entries(1024, 0); static {{sock_map}}: SockHash<SockKey> = SockHash::<SockKey>::with_max_entries(1024, 0);
#[sk_msg(name="{{crate_name}}")] #[sk_msg(name="{{crate_name}}")]
pub fn {{crate_name}}(ctx: SkMsgContext) -> u32 { pub fn {{crate_name}}(ctx: SkMsgContext) -> u32 {

Loading…
Cancel
Save