Skip to content

Commit

Permalink
Fix mislabelled mul64 opcodes
Browse files Browse the repository at this point in the history
mul64 opcodes were labelled as div64 in the comments with an operation equivalent `/=`. They are now accurately labelled as mul64 with an operation equivalent to `*=`
  • Loading branch information
deanmlittle committed May 25, 2024
1 parent 17353e3 commit 12779ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ebpf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ pub const ADD64_REG : u8 = BPF_ALU64 | BPF_X | BPF_ADD;
pub const SUB64_IMM : u8 = BPF_ALU64 | BPF_K | BPF_SUB;
/// BPF opcode: `sub64 dst, src` /// `dst -= src`.
pub const SUB64_REG : u8 = BPF_ALU64 | BPF_X | BPF_SUB;
/// BPF opcode: `div64 dst, imm` /// `dst /= imm`.
/// BPF opcode: `mul64 dst, imm` /// `dst *= imm`.
pub const MUL64_IMM : u8 = BPF_ALU64 | BPF_K | BPF_MUL;
/// BPF opcode: `div64 dst, src` /// `dst /= src`.
/// BPF opcode: `mul64 dst, src` /// `dst *= src`.
pub const MUL64_REG : u8 = BPF_ALU64 | BPF_X | BPF_MUL;
/// BPF opcode: `div64 dst, imm` /// `dst /= imm`.
pub const DIV64_IMM : u8 = BPF_ALU64 | BPF_K | BPF_DIV;
Expand Down

0 comments on commit 12779ed

Please sign in to comment.