Re: [PATCH] [RFC] net: bpf: make __bpf_skb_max_len(skb) an skb-independent constant

From: Jakub Kicinski
Date: Tue Apr 21 2020 - 13:27:25 EST


On Mon, 20 Apr 2020 16:14:27 -0700 Maciej Åenczykowski wrote:
> From: Maciej Åenczykowski <maze@xxxxxxxxxx>
>
> This function is used from:
> bpf_skb_adjust_room
> __bpf_skb_change_tail
> __bpf_skb_change_head
>
> but in the case of forwarding we're likely calling these functions
> during receive processing on ingress and bpf_redirect()'ing at
> a later point in time to egress on another interface, thus these
> mtu checks are for the wrong device.

Interesting. Without redirecting there should also be no reason
to do this check at ingress, right? So at ingress it's either
incorrect or unnecessary?