Skip to content
Commit f4bb2e9c authored by Andy Gospodarek's avatar Andy Gospodarek Committed by David S. Miller
Browse files

bonding: fix string comparison errors



When a bond contains a device where one name is the subset of another
(eth1 and eth10, for example), one cannot properly set the primary
device or the currently active device.

This was reported and based on work by Takuma Umeya.  I also verified
the problem and tested that this fix resolves it.

V2: A few did not like the the current code or my changes, so I
refactored bonding_store_primary and bonding_store_active_slave to be a
bit cleaner, dropped the use of strnicmp since we did not really need
the comparison to be case insensitive, and formatted the input string
from sysfs so a comparison to IFNAMSIZ could be used.

I also discovered an error in bonding_store_active_slave that would
modify bond->primary_slave rather than bond->curr_active_slave before
forcing the bonding driver to choose a new active slave.

V3: Actually sending the proper patch....

Signed-off-by: default avatarAndy Gospodarek <andy@greyhouse.net>
Reported-by: default avatarTakuma Umeya <tumeya@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 550fd08c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment