Skip to content

Commit 5024203

Browse files
committed
bpf: Fix handling of encrypted packets in bpf_host
This commit fixes an issue for encrypted packets arriving in bpf_host. When checking that they are encrypted using the packet mark, we shouldn't expect the mark to be equal to MARK_MAGIC_DECRYPT. Instead, we should check that the MARK_MAGIC_DECRYPT bit is set. This issue isn't affecting anything today, but will once we support IPsec + BPF Host Routing. Fixes: 1dadae3 ("bpf: Don't skip local delivery for plain-text packets") Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
1 parent 1795ab5 commit 5024203

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bpf/bpf_host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ int cil_from_netdev(struct __ctx_buff *ctx)
12721272
* ignore the return value from do_decrypt.
12731273
*/
12741274
do_decrypt(ctx, proto);
1275-
if (ctx->mark == MARK_MAGIC_DECRYPT)
1275+
if ((ctx->mark & MARK_MAGIC_HOST_MASK) == MARK_MAGIC_DECRYPT)
12761276
return CTX_ACT_OK;
12771277
#endif
12781278
ret = tcx_early_hook(ctx, proto);

0 commit comments

Comments
 (0)