bonding: fix active slaves with no primary
bonding: fix active slaves with no primary

If the link state of a slave is "up" when added, it is added to the list
of active slaves but, even if it is the only slave, is not selected as
the primary interface.  Generally, handling of link state interrupts
selects an interface to be primary, but only if the active count is zero.
This change avoids the situation where there are active slaves but
no primary.

Fixes: 2efb58cbab6e ("bond: new link bonding library")

Signed-off-by: Eric Kinzie <a5f92fb8e8f23d46aec912926a1e7934f5ecc306@brocade.com>
Signed-off-by: Stephen Hemminger <06fa905d7f2aaced6dc72e9511c71a2a51e8aead@networkplumber.org>
Acked-by: Declan Doherty <b4388acd850cd8caad5000a112795063f04807ac@intel.com>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk