Message ID | 20200507023606.111650-1-zenczykowski@gmail.com |
---|---|
State | New |
Headers | show |
Series | [v3] net: bpf: permit redirect from ingress L3 to egress L2 devices at near max mtu | expand |
diff --git a/net/core/filter.c b/net/core/filter.c index 7d6ceaa54d21..5c8243930462 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -3159,8 +3159,9 @@ static int bpf_skb_net_shrink(struct sk_buff *skb, u32 off, u32 len_diff, static u32 __bpf_skb_max_len(const struct sk_buff *skb) { - return skb->dev ? skb->dev->mtu + skb->dev->hard_header_len : - SKB_MAX_ALLOC; + if (skb_at_tc_ingress(skb) || !skb->dev) + return SKB_MAX_ALLOC; + return skb->dev->mtu + skb->dev->hard_header_len; } BPF_CALL_4(bpf_skb_adjust_room, struct sk_buff *, skb, s32, len_diff,