diff --git a/aya/src/sys/bpf.rs b/aya/src/sys/bpf.rs index 101823d7..17149377 100644 --- a/aya/src/sys/bpf.rs +++ b/aya/src/sys/bpf.rs @@ -66,7 +66,7 @@ pub(crate) fn bpf_create_map(name: &CStr, def: &obj::Map, btf_fd: Option) _ => { u.btf_key_type_id = m.def.btf_key_type_id; u.btf_value_type_id = m.def.btf_value_type_id; - u.btf_fd = btf_fd.unwrap() as u32; + u.btf_fd = btf_fd.unwrap_or_default() as u32; } } }