bpf: fix loading socket filters from obj files

pull/1/head
Alessandro Decina 4 years ago
parent a8c212377f
commit b75efc8efe

@ -85,6 +85,9 @@ impl Bpf {
crate::obj::ProgramKind::KProbe => Program::KProbe(KProbe { data }),
crate::obj::ProgramKind::UProbe => Program::UProbe(UProbe { data }),
crate::obj::ProgramKind::TracePoint => Program::TracePoint(TracePoint { data }),
crate::obj::ProgramKind::SocketFilter => {
Program::SocketFilter(SocketFilter { data })
}
crate::obj::ProgramKind::Xdp => Program::Xdp(Xdp { data }),
};

@ -56,8 +56,9 @@ pub(crate) struct Program {
pub enum ProgramKind {
KProbe,
UProbe,
Xdp,
TracePoint,
SocketFilter,
Xdp,
}
impl FromStr for ProgramKind {
@ -70,6 +71,7 @@ impl FromStr for ProgramKind {
"uprobe" => UProbe,
"xdp" => Xdp,
"trace_point" => TracePoint,
"socket_filter" => SocketFilter,
_ => {
return Err(ParseError::InvalidProgramKind {
kind: kind.to_string(),

Loading…
Cancel
Save