Skip to content

Commit

Permalink
program_section
Browse files Browse the repository at this point in the history
  • Loading branch information
epompeii committed Mar 27, 2023
1 parent 6a25d4d commit 17f497c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions aya/src/bpf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{

use aya_obj::{
btf::{BtfFeatures, BtfRelocationError},
generated::BPF_F_XDP_HAS_FRAGS,
generated::{BPF_F_SLEEPABLE, BPF_F_XDP_HAS_FRAGS},
relocation::BpfRelocationError,
};
use log::debug;
Expand Down Expand Up @@ -551,9 +551,17 @@ impl<'a> BpfLoader<'a> {
data: ProgramData::new(prog_name, obj, btf_fd, verifier_log_level),
})
}
ProgramSection::Lsm { .. } => Program::Lsm(Lsm {
data: ProgramData::new(prog_name, obj, btf_fd, verifier_log_level),
}),
ProgramSection::Lsm {
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 { .. } => {
Program::BtfTracePoint(BtfTracePoint {
data: ProgramData::new(prog_name, obj, btf_fd, verifier_log_level),
Expand Down

0 comments on commit 17f497c

Please sign in to comment.