Commit fc987b8 Tomasz Jonak
committed
1 parent 1a1f672 commit fc987b8 Copy full SHA for fc987b8
File tree 4 files changed +6
-4
lines changed
4 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ members = [
5
5
" xtask" ,
6
6
" examples/*" ,
7
7
]
8
+ exclude = [" ebpfguard-ebpf" ]
8
9
9
10
[patch .crates-io ]
10
11
aya = { git = " https://github.com/deepfence/aya-rs" , branch = " btf-fixes" }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ default = []
8
8
user = [" aya" ]
9
9
10
10
[dependencies ]
11
- aya = { version = " >=0.11 " , optional = true }
11
+ aya = { git = " https://github.com/deepfence/aya-rs " , branch = " btf-fixes " , optional = true }
12
12
13
13
[lib ]
14
14
path = " src/lib.rs"
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ pub struct PolicyManager {
230
230
231
231
impl PolicyManager {
232
232
/// Default path for storage of eBPFGuard maps
233
- const DEFAULT_BPFFS_MAPS_PATH : & str = "/sys/fs/bpf/ebpfguard_default" ;
233
+ pub const DEFAULT_BPFFS_MAPS_PATH : & str = "/sys/fs/bpf/ebpfguard_default" ;
234
234
235
235
/// Creates a new policy manager with default maps path.
236
236
///
@@ -242,6 +242,7 @@ impl PolicyManager {
242
242
/// let mut policy_manager = PolicyManager::with_default_path().unwrap();
243
243
/// ```
244
244
pub fn with_default_path ( ) -> Result < Self , EbpfguardError > {
245
+ std:: fs:: create_dir_all ( Self :: DEFAULT_BPFFS_MAPS_PATH ) ?;
245
246
Self :: new ( Self :: DEFAULT_BPFFS_MAPS_PATH )
246
247
}
247
248
@@ -260,13 +261,13 @@ impl PolicyManager {
260
261
let bpf = BpfLoader :: new ( )
261
262
. map_pin_path ( & bpf_path)
262
263
. load ( include_bytes_aligned ! (
263
- "../../target/bpfel-unknown-none/debug/ ebpfguard"
264
+ "../../ebpfguard-ebpf/ ebpfguard.debug.obj "
264
265
) ) ?;
265
266
#[ cfg( not( debug_assertions) ) ]
266
267
let bpf = BpfLoader :: new ( )
267
268
. map_pin_path ( & bpf_path)
268
269
. load ( include_bytes_aligned ! (
269
- "../../target/bpfel-unknown-none/release/ ebpfguard"
270
+ "../../ebpfguard-ebpf/ ebpfguard.release.obj "
270
271
) ) ?;
271
272
272
273
Ok ( Self { bpf } )
You can’t perform that action at this time.
0 commit comments