aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/filter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index 0ca6907d7efe..3095f1ba7015 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2779,7 +2779,8 @@ static int bpf_skb_net_shrink(struct sk_buff *skb, u32 len_diff)
2779 2779
2780static u32 __bpf_skb_max_len(const struct sk_buff *skb) 2780static u32 __bpf_skb_max_len(const struct sk_buff *skb)
2781{ 2781{
2782 return skb->dev->mtu + skb->dev->hard_header_len; 2782 return skb->dev ? skb->dev->mtu + skb->dev->hard_header_len :
2783 SKB_MAX_ALLOC;
2783} 2784}
2784 2785
2785static int bpf_skb_adjust_net(struct sk_buff *skb, s32 len_diff) 2786static int bpf_skb_adjust_net(struct sk_buff *skb, s32 len_diff)