Set the stp port name before enabling it, so that debugging messages
have the name to print out.
Do not treat the first state initialization as a state change. Zero
is not a valid state, so changing from zero to STP_DISABLED is not a
state change.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Daniele Venturino <daniele.venturino@m3s.it>
{
ovs_assert(state & (STP_DISABLED | STP_BLOCKING));
stp_become_designated_port(p);
- stp_set_port_state(p, state);
+
+ if (!p->state && state == STP_DISABLED) {
+ p->state = state; /* Do not trigger state change when initializing. */
+ } else {
+ stp_set_port_state(p, state);
+ }
p->topology_change_ack = false;
p->config_pending = false;
p->change_detection_enabled = true;
}
sp = ofport->stp_port = stp_get_port(ofproto->stp, s->port_num);
- stp_port_enable(sp);
+ /* Set name before enabling the port so that debugging messages can print
+ * the name. */
stp_port_set_name(sp, netdev_get_name(ofport->up.netdev));
+ stp_port_enable(sp);
+
stp_port_set_aux(sp, ofport);
stp_port_set_priority(sp, s->priority);
stp_port_set_path_cost(sp, s->path_cost);