summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2024-03-19 12:16:42 -0700
committerMaciej Żenczykowski <maze@google.com>2024-03-19 12:20:06 -0700
commit808340cd0fe586c76d263816d8f3db04feead00e (patch)
tree50567ee00f34ed5b810ac76a4cdc02aa3c5da045
parent7fd6014f4ece11c043322600e5e8cb0e02d09c81 (diff)
downloadapf-808340cd0fe586c76d263816d8f3db04feead00e.tar.gz
v5: fix incorrect comment
I changed this in 'v5: simplify JBSMATCH_OPCODE implementation' from 8 to 4 when I had a 'if (len_field > 2) return PASS_PACKET;' safety check, but that ended up getting reworked, while the comment change wasn't undone. Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I62f0dd2393cb19cf3d2514217ce0e6104420a353
-rw-r--r--v5/apf_interpreter.c2
-rw-r--r--v5/apf_interpreter_source.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/v5/apf_interpreter.c b/v5/apf_interpreter.c
index dd3850a..d668445 100644
--- a/v5/apf_interpreter.c
+++ b/v5/apf_interpreter.c
@@ -795,7 +795,7 @@ static int do_apf_run(apf_context* ctx) {
if (len_field == 0) break;
/* Load second immediate field. */
u32 cmp_imm_len = 1 << (len_field - 1);
- u32 cmp_imm = decode_imm(ctx, cmp_imm_len); /* 2nd imm, at worst 4 bytes past prog_len */
+ u32 cmp_imm = decode_imm(ctx, cmp_imm_len); /* 2nd imm, at worst 8 bytes past prog_len */
/* cmp_imm is size in bytes of data to compare. */
/* pc is offset of program bytes to compare. */
/* imm is jump target offset. */
diff --git a/v5/apf_interpreter_source.c b/v5/apf_interpreter_source.c
index 25df6fa..6c510d8 100644
--- a/v5/apf_interpreter_source.c
+++ b/v5/apf_interpreter_source.c
@@ -261,7 +261,7 @@ static int do_apf_run(apf_context* ctx) {
if (len_field == 0) break;
// Load second immediate field.
u32 cmp_imm_len = 1 << (len_field - 1);
- u32 cmp_imm = decode_imm(ctx, cmp_imm_len); // 2nd imm, at worst 4 bytes past prog_len
+ u32 cmp_imm = decode_imm(ctx, cmp_imm_len); // 2nd imm, at worst 8 bytes past prog_len
// cmp_imm is size in bytes of data to compare.
// pc is offset of program bytes to compare.
// imm is jump target offset.