From 0c4b89b4970a1b6533ac42cdb541d8d7e7510bfb Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Thu, 15 Sep 2022 09:42:53 +0100 Subject: [PATCH] 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 --- {{project-name}}-ebpf/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{project-name}}-ebpf/src/main.rs b/{{project-name}}-ebpf/src/main.rs index a70053a..6779169 100644 --- a/{{project-name}}-ebpf/src/main.rs +++ b/{{project-name}}-ebpf/src/main.rs @@ -145,7 +145,7 @@ use aya_log_ebpf::info; use {{crate_name}}_common::SockKey; #[map(name="{{sock_map}}")] -static mut {{sock_map}}: SockHash = SockHash::::with_max_entries(1024, 0); +static {{sock_map}}: SockHash = SockHash::::with_max_entries(1024, 0); #[sk_msg(name="{{crate_name}}")] pub fn {{crate_name}}(ctx: SkMsgContext) -> u32 {