Re: [PATCH net-next 2/6] net: ipv4: use kfree_skb_reason() in ip_rcv_core()

From: David Ahern
Date: Tue Jan 25 2022 - 21:10:49 EST


On 1/24/22 6:15 AM, menglong8.dong@xxxxxxxxx wrote:
> @@ -478,7 +483,7 @@ static struct sk_buff *ip_rcv_core(struct sk_buff *skb, struct net *net)
> IPSTATS_MIB_NOECTPKTS + (iph->tos & INET_ECN_MASK),
> max_t(unsigned short, 1, skb_shinfo(skb)->gso_segs));
>
> - if (!pskb_may_pull(skb, iph->ihl*4))
> + if (!pskb_may_pull(skb, iph->ihl * 4))

unrelated cleanup

> goto inhdr_error;
>
> iph = ip_hdr(skb);
> @@ -490,7 +495,7 @@ static struct sk_buff *ip_rcv_core(struct sk_buff *skb, struct net *net)
> if (skb->len < len) {
> __IP_INC_STATS(net, IPSTATS_MIB_INTRUNCATEDPKTS);
> goto drop;
> - } else if (len < (iph->ihl*4))
> + } else if (len < (iph->ihl * 4))

ditto

> goto inhdr_error;
>
> /* Our transport medium may have padded the buffer out. Now we know it