diff options
author | nickcooper-zhangtonghao <nic@opencloud.tech> | 2017-02-13 22:52:50 -0800 |
---|---|---|
committer | Andy Zhou <azhou@ovn.org> | 2017-02-15 12:45:23 -0800 |
commit | 49dd114138d747f20cc15a9705a5f9f84775c01c (patch) | |
tree | bdd088ca974b9f0c1d23a4e977b5ad47517a67e1 | |
parent | c184a11164e9eb41f004d8e08a67982c7db74afd (diff) | |
download | openvswitch-49dd114138d747f20cc15a9705a5f9f84775c01c.tar.gz |
ofproto/bond: Validate active-slave mac.
That the mac of active-slave is invalid(e.g. 00:00:00:00:00:00)
is incidental. The reason is described as below.
In the bridge_reconfig():
1. bond devices created in port_configure().
2. the bonded interfaces may be disabled even calling bridge_run__(),
because the interface link is not ready.
The OvS will run bridge_run__() in next loop. In next loop, the
active-slave may be selected. But OvS the bridge_reconfig() again,
the bond_reconfigure() set active-slave mac zero and flag false.
If using the 'ovs-appctl bond/show bond-name' to check active-slave
mac, you will find the mac is zero and mac in the ovsdb is also zero.
The active_slave_mac and active_slave_changed should be initialized
when created.
Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Andy Zhou <azhou@ovn.org>
-rw-r--r-- | ofproto/bond.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ofproto/bond.c b/ofproto/bond.c index c2749e52d..d2344ae9a 100644 --- a/ofproto/bond.c +++ b/ofproto/bond.c @@ -241,6 +241,9 @@ bond_create(const struct bond_settings *s, struct ofproto_dpif *ofproto) bond->recirc_id = 0; hmap_init(&bond->pr_rule_ops); + bond->active_slave_mac = eth_addr_zero; + bond->active_slave_changed = false; + bond_reconfigure(bond, s); return bond; } @@ -458,9 +461,6 @@ bond_reconfigure(struct bond *bond, const struct bond_settings *s) bond_entry_reset(bond); } - bond->active_slave_mac = s->active_slave_mac; - bond->active_slave_changed = false; - ovs_rwlock_unlock(&rwlock); return revalidate; } |