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:	Mon, 06 Oct 2014 15:05:26 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org, ja@....bg
Subject: Re: [PATCH v2 net-next] net: better IFF_XMIT_DST_RELEASE support

On Mon, 2014-10-06 at 17:50 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@...il.com>
> Date: Sun, 05 Oct 2014 18:38:35 -0700
> 
> > @@ -1001,7 +1001,8 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
> >  
> >  static void bond_compute_features(struct bonding *bond)
> >  {
> > -	unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;
> > +	unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
> > +					IFF_XMIT_DST_RELEASE_PERM;
> >  	netdev_features_t vlan_features = BOND_VLAN_FEATURES;
> >  	netdev_features_t enc_features  = BOND_ENC_FEATURES;
> >  	struct net_device *bond_dev = bond->dev;
> > @@ -1037,8 +1038,10 @@ done:
> >  	bond_dev->gso_max_segs = gso_max_segs;
> >  	netif_set_gso_max_size(bond_dev, gso_max_size);
> >  
> > -	flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE;
> > -	bond_dev->priv_flags = flags | dst_release_flag;
> > +	bond_dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
> > +	if ((bond_dev->priv_flags & IFF_XMIT_DST_RELEASE_PERM) &&
> > +	    dst_release_flag == (IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM))
> > +		bond_dev->priv_flags |= IFF_XMIT_DST_RELEASE;
> 
> I think I might be missing something, but in all of these places where
> you add this logic, it looks to me like:
> 
> 	dst_release_flag = CONSTANT;
> 	...
> 	if (... &&
> 	    dst_release_flags == CONSTANT)
> 
> This 'dst_release_flag' variable never changes, so why bother with the
> test at all?


We have a loop over team/bonding members, where we do :

dst_release_flag &= slave->dev->priv_flags;

So at the end of the loop, we check if any one of the member had one of
the bit cleared.

if dst_release_flags has both bits set, then we are set and we allow the
IFF_XMIT_DST_RELEASE being set on the master.






--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ