diff --git a/src/ebpf.rs b/src/ebpf.rs index d02220264..8ae179801 100644 --- a/src/ebpf.rs +++ b/src/ebpf.rs @@ -447,9 +447,9 @@ pub const JSLE_REG: u8 = BPF_JMP | BPF_X | BPF_JSLE; pub const CALL_IMM: u8 = BPF_JMP | BPF_CALL; /// BPF opcode: tail call. pub const CALL_REG: u8 = BPF_JMP | BPF_X | BPF_CALL; -/// BPF opcode: `exit` /// `return r0`. /// Valid only for SBFv1 +/// BPF opcode: `exit` /// `return r0`. /// Valid only for SBPFv1 pub const EXIT: u8 = BPF_JMP | BPF_EXIT; -/// BPF opcode: `return` /// `return r0`. /// Valid only for SBFv2 +/// BPF opcode: `return` /// `return r0`. /// Valid only for SBPFv2 pub const RETURN: u8 = BPF_JMP | BPF_X | BPF_EXIT; // Used in JIT diff --git a/tests/execution.rs b/tests/execution.rs index 39b34f7ea..cfec8a7dd 100644 --- a/tests/execution.rs +++ b/tests/execution.rs @@ -4148,15 +4148,15 @@ fn test_mod() { #[test] fn test_invalid_exit_or_return() { - for sbf_version in [SBPFVersion::V1, SBPFVersion::V2] { - let final_instr = if sbf_version == SBPFVersion::V1 { + for sbpf_version in [SBPFVersion::V1, SBPFVersion::V2] { + let final_instr = if sbpf_version == SBPFVersion::V1 { "return" } else { "exit" }; let config = Config { - enabled_sbpf_versions: sbf_version..=sbf_version, + enabled_sbpf_versions: sbpf_version..=sbpf_version, enable_instruction_tracing: true, ..Config::default() };