Skip to content

Commit

Permalink
bonding: fix vlan_features computing
Browse files Browse the repository at this point in the history
bond_compute_features() uses netdev_increment_features() to
combine vlan_features of slaves into vlan_features of the bond.
As netdev_increment_features() only adds most features and we
start with BOND_VLAN_FEATURES, we can end up with features none
of the slaves provided.

If there is at least one slave, initialize vlan_features only
with the flags in NETIF_F_ALL_FOR_ALL. Right now there is none
in BOND_VLAN_FEATURES but stating it explicitely will make the
code more future proof.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
mkubecek authored and davem330 committed May 22, 2014
1 parent da08143 commit a9b3ace
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ static void bond_compute_features(struct bonding *bond)

if (!bond_has_slaves(bond))
goto done;
vlan_features &= NETIF_F_ALL_FOR_ALL;

bond_for_each_slave(bond, slave, iter) {
vlan_features = netdev_increment_features(vlan_features,
Expand Down

0 comments on commit a9b3ace

Please sign in to comment.