Re: [PATCH net-next v4 03/10] gre: make gre_parse_header() report a drop reason

From: Anton Danilov

Date: Fri Sep 25 2026 - 19:14:04 EST


On Wed, Sep 23, 2026 at 05:59:31PM +0300, Ido Schimmel wrote:
> On Wed, Sep 23, 2026 at 01:15:00AM +0300, Anton Danilov wrote:
> > if (unlikely(!pskb_may_pull(skb, nhs + sizeof(struct gre_base_hdr))))
> > - return -EINVAL;
> > + return SKB_DROP_REASON_HDR_TRUNC;
>
> Please use pskb_may_pull_reason() as is done throughout the kernel.
> AFAICT, there's only one user of HDR_TRUNC (in tun) and it should also
> be converted to pskb_may_pull_reason() so that we could remove
> HDR_TRUNC. Can you send a patch?

Sure, I will send it separately. It does not depend on this series, as
v5 will no longer use HDR_TRUNC.

...

> > - if (ver >= GREPROTO_MAX)
> > + if (ver >= GREPROTO_MAX) {
> > + reason = SKB_DROP_REASON_UNHANDLED_PROTO;
>
> This should be TUNNEL_INVALID_HDR to be consistent with the hunk above.

Agreed, will change in v5.