Re: [PATCH net-next v4 04/10] ip_tunnel: add __iptunnel_pull_header_reason()
From: Ido Schimmel
Date: Mon Sep 28 2026 - 02:47:44 EST
On Sat, Sep 26, 2026 at 02:12:15AM +0300, Anton Danilov wrote:
> On Wed, Sep 23, 2026 at 06:41:14PM +0300, Ido Schimmel wrote:
> > Either append patches to this series or as a follow-up, after this
> > series the only caller of __iptunnel_pull_header() other than
> > iptunnel_pull_header() is the VXLAN driver and it should be converted to
> > report the actual drop reason instead of NOMEM:
>
> ...
>
> > Then remove __iptunnel_pull_header():
>
> ...
>
> > +static inline bool iptunnel_pull_header(struct sk_buff *skb, int hdr_len,
> > + __be16 inner_proto, bool xnet)
>
> ...
>
> Thanks, I will add both changes to v5.
>
> One question before I send it: is there a reason to prefer bool here?
> All the callers only test the result for failure, so bool works for
> them, but coding-style.rst (section 16) says that a function whose name
> is an action should return an error-code integer. I can keep the int
> return, as it is in net-next now, or go with bool as in your diff,
> whichever you prefer.
Looking at it again, why do we even need
__iptunnel_pull_header_reason()?
All the callers of __iptunnel_pull_header() and iptunnel_pull_header()
treat the return value as a boolean. Can't you just change their return
type to 'enum skb_drop_reason'?