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]
Message-ID: <20201002084102.sf7w5d76lf2swatq@skbuf>
Date:   Fri, 2 Oct 2020 08:41:03 +0000
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     Florian Fainelli <f.fainelli@...il.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        open list <linux-kernel@...r.kernel.org>,
        "olteanv@...il.com" <olteanv@...il.com>
Subject: Re: [PATCH net-next 3/4] net: dsa: Obtain VLAN protocol from
 skb->protocol

On Thu, Oct 01, 2020 at 07:42:14PM -0700, Florian Fainelli wrote:
> Now that dsa_untag_bridge_pvid() is called after eth_type_trans() we are
> guaranteed that skb->protocol will be set to a correct value, thus
> allowing us to avoid calling vlan_eth_hdr().
> 
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@....com>

>  net/dsa/dsa_priv.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
> index 0348dbab4131..d6ce8c2a2590 100644
> --- a/net/dsa/dsa_priv.h
> +++ b/net/dsa/dsa_priv.h
> @@ -201,7 +201,6 @@ dsa_slave_to_master(const struct net_device *dev)
>  static inline struct sk_buff *dsa_untag_bridge_pvid(struct sk_buff *skb)
>  {
>  	struct dsa_port *dp = dsa_slave_to_port(skb->dev);
> -	struct vlan_ethhdr *hdr = vlan_eth_hdr(skb);
>  	struct net_device *br = dp->bridge_dev;
>  	struct net_device *dev = skb->dev;
>  	struct net_device *upper_dev;
> @@ -217,7 +216,7 @@ static inline struct sk_buff *dsa_untag_bridge_pvid(struct sk_buff *skb)
>  		return skb;
>  
>  	/* Move VLAN tag from data to hwaccel */
> -	if (!skb_vlan_tag_present(skb) && hdr->h_vlan_proto == htons(proto)) {
> +	if (!skb_vlan_tag_present(skb) && skb->protocol == htons(proto)) {
>  		skb = skb_vlan_untag(skb);
>  		if (!skb)
>  			return NULL;
> -- 
> 2.25.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ