program_section

pull/545/head
epompeii 2 years ago
parent 6a25d4ddec
commit 17f497ce42

@ -9,7 +9,7 @@ use std::{
use aya_obj::{ use aya_obj::{
btf::{BtfFeatures, BtfRelocationError}, btf::{BtfFeatures, BtfRelocationError},
generated::BPF_F_XDP_HAS_FRAGS, generated::{BPF_F_SLEEPABLE, BPF_F_XDP_HAS_FRAGS},
relocation::BpfRelocationError, relocation::BpfRelocationError,
}; };
use log::debug; use log::debug;
@ -551,9 +551,17 @@ impl<'a> BpfLoader<'a> {
data: ProgramData::new(prog_name, obj, btf_fd, verifier_log_level), data: ProgramData::new(prog_name, obj, btf_fd, verifier_log_level),
}) })
} }
ProgramSection::Lsm { .. } => Program::Lsm(Lsm { ProgramSection::Lsm {
data: ProgramData::new(prog_name, obj, btf_fd, verifier_log_level), sleepable_supported,
}), ..
} => {
let mut data =
ProgramData::new(prog_name, obj, btf_fd, verifier_log_level);
if *sleepable_supported {
data.flags = BPF_F_SLEEPABLE;
}
Program::Lsm(Lsm { data })
}
ProgramSection::BtfTracePoint { .. } => { ProgramSection::BtfTracePoint { .. } => {
Program::BtfTracePoint(BtfTracePoint { Program::BtfTracePoint(BtfTracePoint {
data: ProgramData::new(prog_name, obj, btf_fd, verifier_log_level), data: ProgramData::new(prog_name, obj, btf_fd, verifier_log_level),

Loading…
Cancel
Save