};
struct stp {
- struct list node; /* Node in all_stps list. */
+ struct ovs_list node; /* Node in all_stps list. */
/* Static bridge data. */
char *name; /* Human-readable name for log messages. */
};
static struct ovs_mutex mutex;
-static struct list all_stps__ = LIST_INITIALIZER(&all_stps__);
-static struct list *const all_stps OVS_GUARDED_BY(mutex) = &all_stps__;
+static struct ovs_list all_stps__ = LIST_INITIALIZER(&all_stps__);
+static struct ovs_list *const all_stps OVS_GUARDED_BY(mutex) = &all_stps__;
#define FOR_EACH_ENABLED_PORT(PORT, STP) \
for ((PORT) = stp_next_enabled_port((STP), (STP)->ports); \
/* Returns true if 'state' is one in which packets received on a port should
* be forwarded, false otherwise.
- *
- * Returns true if 'state' is STP_DISABLED, since presumably in that case the
- * port should still work, just not have STP applied to it. */
+ */
bool
stp_forward_in_state(enum stp_state state)
{
- return (state & (STP_DISABLED | STP_FORWARDING)) != 0;
+ return (state & STP_FORWARDING) != 0;
}
/* Returns true if 'state' is one in which MAC learning should be done on
* packets received on a port, false otherwise.
- *
- * Returns true if 'state' is STP_DISABLED, since presumably in that case the
- * port should still work, just not have STP applied to it. */
+ */
bool
stp_learn_in_state(enum stp_state state)
{
- return (state & (STP_DISABLED | STP_LEARNING | STP_FORWARDING)) != 0;
+ return (state & (STP_LEARNING | STP_FORWARDING)) != 0;
}
/* Returns true if 'state' is one in which bpdus should be forwarded on a
{
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;