Re: [PATCH net-next v1 07/15] bpf: don't redirect decrypted skbs from egress to ingress
From: Todd Bert Freed
Date: Wed Nov 18 2026 - 12:46:51 EST
> > + /* On transmit, decrypted asks the device to encrypt the packet. Sent
> > + * to ingress, the packet would read as decrypted by the device.
> > + */
> > + if (unlikely((flags & BPF_F_INGRESS) && !skb_at_tc_ingress(skb) &&
> > + skb_is_decrypted(skb))) {
> > + kfree_skb(skb);
> > + return -EINVAL;
>
> This check should rather live in the bpf_redirect (and friends) helper e.g. after
> we check for invalid params, etc, rather than here which feels off. Also, it would
> probably make sense to refactor this condition into a small inline helper so you
> don't have to open code it multiple times.
Sounds good I will move this check into the two callers
(bpf_clone_redirect() and
skb_do_redirect()) under a helper.
FYI this patch was moved to the net series "net: don't redirect
decrypted skbs to
ingress, psp time-wait validator", so you will see this applied to v3 there.
-Todd