lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 26 Sep 2020 20:49:49 +0000
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     Andrew Lunn <andrew@...n.ch>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "f.fainelli@...il.com" <f.fainelli@...il.com>,
        "vivien.didelot@...il.com" <vivien.didelot@...il.com>,
        "kuba@...nel.org" <kuba@...nel.org>
Subject: Re: [PATCH v3 net-next 06/15] net: dsa: add a generic procedure for
 the flow dissector

On Sat, Sep 26, 2020 at 10:33:00PM +0200, Andrew Lunn wrote:
> > +static inline void dsa_tag_generic_flow_dissect(const struct sk_buff *skb,
> > +						__be16 *proto, int *offset)
> > +{
> > +#if IS_ENABLED(CONFIG_NET_DSA)
> > +	const struct dsa_device_ops *ops = skb->dev->dsa_ptr->tag_ops;
> > +	int tag_len = ops->overhead;
> > +
> > +	*offset = tag_len;
> > +	*proto = ((__be16 *)skb->data)[(tag_len / 2) - 1];
> > +#endif
> > +}
> > +
>
> Do you actually need the IS_ENABLED()? There is only one caller of
> this function, and it is already protected by
> IS_ENABLED(CONFIG_NET_DSA). So i don't think it adds anything.

It doesn't matter how many callers it has, it doesn't compile when
NET_DSA=n:

./include/net/dsa.h: In function ‘dsa_tag_generic_flow_dissect’:
./include/net/dsa.h:732:47: error: ‘struct net_device’ has no member named ‘dsa_ptr’; did you mean ‘ip_ptr’?
  const struct dsa_device_ops *ops = skb->dev->dsa_ptr->tag_ops;
                                               ^~~~~~~
                                               ip_ptr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ