Fix socket_filter section match

`BPF_PROG_TYPE_SOCKET_FILTER` program expands the sectionname's kind with `socket` not `socket_filter`.
So current eBPF program with socket filter always fails.

This patch fixes it.

Fix https://github.com/aya-rs/aya/issues/227
pull/228/head
Kenjiro Nakayama 3 years ago
parent e0d818ff2d
commit 9e41317ca6

@ -184,7 +184,7 @@ impl FromStr for ProgramSection {
let name = section.splitn(2, '/').last().unwrap().to_owned();
TracePoint { name }
}
"socket_filter" => SocketFilter { name },
"socket" => SocketFilter { name },
"sk_msg" => SkMsg { name },
"sk_skb" => match &*name {
"stream_parser" => SkSkbStreamParser { name },

Loading…
Cancel
Save