disabled_slave = slave2;
}
- if (bond->alb_info.slb_enabled)
- slb_send_learning_packets(bond);
-
if (bond->alb_info.rlb_enabled && slaves_state_differ) {
/* A disabled slave was assigned an active mac addr */
rlb_teach_disabled_mac_on_primary(bond,
int res;
int i;
- if (bond->alb_info.rlb_enabled) {
+ if (bond->alb_info.rlb_enabled || bond->alb_info.slb_enabled) {
return 0;
}
}
}
- if (bond->alb_info.slb_enabled)
- slb_send_learning_packets(bond);
-
read_unlock(&bond->curr_slave_lock);
bond_info->tx_rebalance_counter = 0;
{
int res;
- res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr,
- bond->alb_info.rlb_enabled);
- if (res) {
- return res;
- }
+ if (!bond->alb_info.slb_enabled) {
+ res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr,
+ bond->alb_info.rlb_enabled);
+ if (res) {
+ return res;
+ }
- /* caller must hold the bond lock for write since the mac addresses
- * are compared and may be swapped.
- */
- write_lock_bh(&bond->lock);
+ /* caller must hold the bond lock for write since the mac addresses
+ * are compared and may be swapped.
+ */
+ write_lock_bh(&bond->lock);
- res = alb_handle_addr_collision_on_attach(bond, slave);
+ res = alb_handle_addr_collision_on_attach(bond, slave);
- write_unlock_bh(&bond->lock);
+ write_unlock_bh(&bond->lock);
- if (res) {
- return res;
+ if (res) {
+ return res;
+ }
}
tlb_init_slave(slave);
/* Caller must hold bond lock for write */
void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave)
{
- if (bond->slave_cnt > 1) {
+ if (bond->alb_info.slb_enabled && bond->slave_cnt > 1) {
alb_change_hw_addr_on_detach(bond, slave);
}
swap_slave = bond->curr_active_slave;
bond->curr_active_slave = new_slave;
- if (!new_slave || (bond->slave_cnt == 0)) {
+ if (!new_slave || (bond->slave_cnt == 0) || bond->alb_info.slb_enabled) {
return;
}
* Otherwise we'll need to pass the new address to it and handle
* duplications.
*/
- if (!bond->curr_active_slave) {
+ if (!bond->curr_active_slave || bond->alb_info.slb_enabled) {
return 0;
}
struct learning_pkt pkt;
int size = sizeof(struct learning_pkt);
char *data;
+ int len;
const unsigned char dest_hw[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
memset(&pkt, 0, size);
memcpy(pkt.mac_dst, dest_hw, ETH_ALEN);
memcpy(pkt.mac_src, src_hw, ETH_ALEN);
pkt.type = __constant_htons(ETH_P_LOOP);
+ len = sprintf(&pkt.padding[0], "Citrix XenServer Failover");
+ len++; /* NULL */
+ memcpy(&pkt.padding[len], src_hw, ETH_ALEN); len += ETH_ALEN;
+ memcpy(&pkt.padding[len], dev->dev_addr, ETH_ALEN); len += ETH_ALEN;
skb = dev_alloc_skb(size);
if (!skb)