static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
{
struct bonding *bond = bond_get_bond_by_slave(slave);
- u16 vlan_id;
- int i;
-
- for (i = 0; i < MAX_LP_BURST; i++) {
- vlan_id = 0;
-
- if (bond_vlan_used(bond)) {
- struct vlan_entry *vlan;
+ struct net_device *upper;
+ struct list_head *iter;
- vlan = bond_next_vlan(bond,
- bond->alb_info.current_alb_vlan);
-
- bond->alb_info.current_alb_vlan = vlan;
- if (!vlan)
- continue;
-
- vlan_id = vlan->vlan_id;
- }
+ /* send untagged */
+ alb_send_lp_vid(slave, mac_addr, 0);
- alb_send_lp_vid(slave, mac_addr, vlan_id);
+ /* loop through vlans and send one packet for each */
+ rcu_read_lock();
+ netdev_for_each_upper_dev_rcu(bond->dev, upper, iter) {
+ if (upper->priv_flags & IFF_802_1Q_VLAN)
+ alb_send_lp_vid(slave, mac_addr,
+ vlan_dev_vlan_id(upper));
}
+ rcu_read_unlock();
}
static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[])