From 212eb539a02531c396ee3380676113e11f980167 Mon Sep 17 00:00:00 2001
From: belohnung <35181949+belohnung@users.noreply.github.com>
Date: Tue, 26 Mar 2024 16:37:42 +0100
Subject: [PATCH] fix(aya): fix panic when creating map on custom ubuntu kernel
---
aya/src/util.rs | 36 +++++++++++++++++++++++++++---------
1 file changed, 27 insertions(+), 9 deletions(-)
diff --git a/aya/src/util.rs b/aya/src/util.rs
index eaeb9e7f..17371460 100644
--- a/aya/src/util.rs
+++ b/aya/src/util.rs
@@ -88,19 +88,31 @@ impl KernelVersion {
(u32::from(major) << 16) + (u32::from(minor) << 8) + u32::from(patch)
}
- // This is ported from https://github.com/torvalds/linux/blob/3f01e9f/tools/lib/bpf/libbpf_probes.c#L21-L101.
-
+ // These (get_ubuntu_kernel_version, parse_ubuntu_kernel_version, read_ubuntu_kernel_version_file)
+ // are ported from https://github.com/torvalds/linux/blob/3f01e9f/tools/lib/bpf/libbpf_probes.c#L21-L101.
fn get_ubuntu_kernel_version() -> Result