static void port_configure(struct port *);
static struct lacp_settings *port_configure_lacp(struct port *,
struct lacp_settings *);
-static void port_configure_bond(struct port *, struct bond_settings *);
+static void port_configure_bond(struct port *, struct bond_settings *,
+ uint32_t *bond_stable_ids);
static void bridge_configure_mirrors(struct bridge *);
static struct mirror *mirror_create(struct bridge *,
/* Get bond settings. */
if (s.n_slaves > 1) {
- port_configure_bond(port, &bond_settings);
s.bond = &bond_settings;
+ s.bond_stable_ids = xmalloc(s.n_slaves * sizeof *s.bond_stable_ids);
+ port_configure_bond(port, &bond_settings, s.bond_stable_ids);
} else {
s.bond = NULL;
+ s.bond_stable_ids = NULL;
}
/* Register. */
/* Clean up. */
free(s.trunks);
free(s.lacp_slaves);
+ free(s.bond_stable_ids);
}
/* Pick local port hardware address and datapath ID for 'br'. */
}
static void
-port_configure_bond(struct port *port, struct bond_settings *s)
+port_configure_bond(struct port *port, struct bond_settings *s,
+ uint32_t *bond_stable_ids)
{
const char *detect_s;
+ struct iface *iface;
+ size_t i;
s->name = port->name;
s->balance = BM_SLB;
}
s->fake_iface = port->cfg->bond_fake_iface;
+
+ i = 0;
+ LIST_FOR_EACH (iface, port_elem, &port->ifaces) {
+ long long stable_id;
+
+ stable_id = atoll(get_interface_other_config(iface->cfg,
+ "bond-stable-id", "0"));
+ if (stable_id <= 0 || stable_id >= UINT32_MAX) {
+ stable_id = iface->ofp_port;
+ }
+ bond_stable_ids[i++] = stable_id;
+ }
}
\f
/* Interface functions. */