On Mon, 09 Jun 2025 09:50:30 -0400 Willem de Bruijn wrote:
if (ret)
return ret;
bpf_compute_data_pointers(skb);
return ret;
I wonder whether that unconditional call to bpf_compute_data_pointers even if ret was there for a reason.
From reviewing the bpf_skb_proto_xlat error paths, it does seem safe to remove it. The cases where an error may be returned after the skb is modified only modify the skb in terms of headroom, not headlen.
I should have mentioned, I looked around and also concluded this unconditional recompute was purely aesthetic.