aya: fix some badly completed match arms

pull/1/head
Alessandro Decina 4 years ago
parent ee05f9d949
commit d3482c063c

@ -13,7 +13,7 @@ use crate::{
maps::{Map, MapError, MapLock, MapRef, MapRefMut}, maps::{Map, MapError, MapLock, MapRef, MapRefMut},
obj::{ obj::{
btf::{Btf, BtfError}, btf::{Btf, BtfError},
Object, ParseError, Object, ParseError, ProgramKind,
}, },
programs::{ programs::{
probe::ProbeKind, KProbe, Program, ProgramData, ProgramError, SocketFilter, TracePoint, probe::ProbeKind, KProbe, Program, ProgramData, ProgramError, SocketFilter, TracePoint,
@ -114,27 +114,25 @@ impl Bpf {
links: Vec::new(), links: Vec::new(),
}; };
let program = match kind { let program = match kind {
crate::obj::ProgramKind::KProbe => Program::KProbe(KProbe { ProgramKind::KProbe => Program::KProbe(KProbe {
data, data,
kind: ProbeKind::KProbe, kind: ProbeKind::KProbe,
}), }),
crate::obj::ProgramKind::KRetProbe => Program::KProbe(KProbe { ProgramKind::KRetProbe => Program::KProbe(KProbe {
data, data,
kind: ProbeKind::KRetProbe, kind: ProbeKind::KRetProbe,
}), }),
crate::obj::ProgramKind::UProbe => Program::UProbe(UProbe { ProgramKind::UProbe => Program::UProbe(UProbe {
data, data,
kind: ProbeKind::UProbe, kind: ProbeKind::UProbe,
}), }),
crate::obj::ProgramKind::URetProbe => Program::UProbe(UProbe { ProgramKind::URetProbe => Program::UProbe(UProbe {
data, data,
kind: ProbeKind::URetProbe, kind: ProbeKind::URetProbe,
}), }),
crate::obj::ProgramKind::TracePoint => Program::TracePoint(TracePoint { data }), ProgramKind::TracePoint => Program::TracePoint(TracePoint { data }),
crate::obj::ProgramKind::SocketFilter => { ProgramKind::SocketFilter => Program::SocketFilter(SocketFilter { data }),
Program::SocketFilter(SocketFilter { data }) ProgramKind::Xdp => Program::Xdp(Xdp { data }),
}
crate::obj::ProgramKind::Xdp => Program::Xdp(Xdp { data }),
}; };
(name, program) (name, program)

Loading…
Cancel
Save