platform: don't fallback to IFLA_BOND_ACTIVE_SLAVE for the primary

The IFLA_BOND_ACTIVE_SLAVE and IFLA_BOND_PRIMARY are not the same.
If the primary is not set, then that's it. Don't fallback.

Only NetworkManager API deprecated "active-slave" and uses it as
alias for "primary". That does not mean, kernel/netlink does that.

(cherry picked from commit 6d95c406db)
This commit is contained in:
Thomas Haller 2022-09-06 10:25:34 +02:00 committed by Fernando Fernandez Mancera
parent 0fa240459e
commit 2d4b96cb54

View file

@ -1589,11 +1589,8 @@ _parse_lnk_bond(const char *kind, struct nlattr *info_data)
if (tb[IFLA_BOND_MODE])
props->mode = nla_get_u8(tb[IFLA_BOND_MODE]);
if (tb[IFLA_BOND_PRIMARY]) {
if (tb[IFLA_BOND_PRIMARY])
props->primary = nla_get_u32(tb[IFLA_BOND_PRIMARY]);
} else if (tb[IFLA_BOND_ACTIVE_SLAVE]) {
props->primary = nla_get_u32(tb[IFLA_BOND_ACTIVE_SLAVE]);
}
if (tb[IFLA_BOND_MIIMON]) {
props->miimon = nla_get_u32(tb[IFLA_BOND_MIIMON]);
props->miimon_has = TRUE;