diff options
-rw-r--r-- | src/vnet/bonding/cli.c | 8 | ||||
-rw-r--r-- | src/vnet/bonding/node.c | 33 |
2 files changed, 21 insertions, 20 deletions
diff --git a/src/vnet/bonding/cli.c b/src/vnet/bonding/cli.c index 91c6e2cdb7d..cd1322db4af 100644 --- a/src/vnet/bonding/cli.c +++ b/src/vnet/bonding/cli.c @@ -516,11 +516,13 @@ bond_enslave (vlib_main_t * vm, bond_enslave_args_t * args) ethernet_set_rx_redirect (vnm, sif_hw, 1); } - if ((bif->mode == BOND_MODE_LACP) && bm->lacp_enable_disable) + if (bif->mode == BOND_MODE_LACP) { - (*bm->lacp_enable_disable) (vm, bif, sif, 1); + if (bm->lacp_enable_disable) + (*bm->lacp_enable_disable) (vm, bif, sif, 1); } - else + else if (sif->port_enabled && + (sif_hw->flags & VNET_HW_INTERFACE_FLAG_LINK_UP)) { bond_enable_collecting_distributing (vm, sif); } diff --git a/src/vnet/bonding/node.c b/src/vnet/bonding/node.c index 7abd7b0de32..a4d88ad099f 100644 --- a/src/vnet/bonding/node.c +++ b/src/vnet/bonding/node.c @@ -404,19 +404,21 @@ bond_sw_interface_up_down (vnet_main_t * vnm, u32 sw_if_index, u32 flags) if (sif) { sif->port_enabled = flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP; + if (sif->lacp_enabled) + return 0; + if (sif->port_enabled == 0) { - if (sif->lacp_enabled == 0) - { - bond_disable_collecting_distributing (vm, sif); - } + bond_disable_collecting_distributing (vm, sif); } else { - if (sif->lacp_enabled == 0) - { - bond_enable_collecting_distributing (vm, sif); - } + vnet_main_t *vnm = vnet_get_main (); + vnet_hw_interface_t *hw = + vnet_get_sup_hw_interface (vnm, sw_if_index); + + if (hw->flags & VNET_HW_INTERFACE_FLAG_LINK_UP) + bond_enable_collecting_distributing (vm, sif); } } @@ -437,19 +439,16 @@ bond_hw_interface_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags) sif = bond_get_slave_by_sw_if_index (sw->sw_if_index); if (sif) { + if (sif->lacp_enabled) + return 0; + if (!(flags & VNET_HW_INTERFACE_FLAG_LINK_UP)) { - if (sif->lacp_enabled == 0) - { - bond_disable_collecting_distributing (vm, sif); - } + bond_disable_collecting_distributing (vm, sif); } - else + else if (sif->port_enabled) { - if (sif->lacp_enabled == 0) - { - bond_enable_collecting_distributing (vm, sif); - } + bond_enable_collecting_distributing (vm, sif); } } |