X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fstp.c;h=814026306fc0cebb9e5284f92168a26244650c35;hb=60d02c72941d5a4aeea85090f120a0cc03e945f2;hp=6e1efd07a952c7d67164188be7237507366eba32;hpb=834d6cafe4797861b7547966b4dcc95b374331be;p=sliver-openvswitch.git diff --git a/lib/stp.c b/lib/stp.c index 6e1efd07a..814026306 100644 --- a/lib/stp.c +++ b/lib/stp.c @@ -26,8 +26,10 @@ #include #include #include "byte-order.h" +#include "connectivity.h" #include "ofpbuf.h" #include "packets.h" +#include "seq.h" #include "unixctl.h" #include "util.h" #include "vlog.h" @@ -666,7 +668,7 @@ stp_state_name(enum stp_state state) case STP_BLOCKING: return "blocking"; default: - NOT_REACHED(); + OVS_NOT_REACHED(); } } @@ -707,7 +709,7 @@ stp_role_name(enum stp_role role) case STP_ROLE_DISABLED: return "disabled"; default: - NOT_REACHED(); + OVS_NOT_REACHED(); } } @@ -727,7 +729,7 @@ stp_received_bpdu(struct stp_port *p, const void *bpdu, size_t bpdu_size) } if (bpdu_size < sizeof(struct stp_bpdu_header)) { - VLOG_WARN("%s: received runt %zu-byte BPDU", stp->name, bpdu_size); + VLOG_WARN("%s: received runt %"PRIuSIZE"-byte BPDU", stp->name, bpdu_size); p->error_count++; goto out; } @@ -747,7 +749,7 @@ stp_received_bpdu(struct stp_port *p, const void *bpdu, size_t bpdu_size) switch (header->bpdu_type) { case STP_TYPE_CONFIG: if (bpdu_size < sizeof(struct stp_config_bpdu)) { - VLOG_WARN("%s: received config BPDU with invalid size %zu", + VLOG_WARN("%s: received config BPDU with invalid size %"PRIuSIZE, stp->name, bpdu_size); p->error_count++; goto out; @@ -757,7 +759,7 @@ stp_received_bpdu(struct stp_port *p, const void *bpdu, size_t bpdu_size) case STP_TYPE_TCN: if (bpdu_size != sizeof(struct stp_tcn_bpdu)) { - VLOG_WARN("%s: received TCN BPDU with invalid size %zu", + VLOG_WARN("%s: received TCN BPDU with invalid size %"PRIuSIZE, stp->name, bpdu_size); p->error_count++; goto out; @@ -1127,6 +1129,7 @@ stp_configuration_update(struct stp *stp) OVS_REQUIRES(mutex) { stp_root_selection(stp); stp_designated_port_selection(stp); + seq_change(connectivity_seq_get()); } static bool @@ -1257,6 +1260,7 @@ stp_set_port_state(struct stp_port *p, enum stp_state state) if (p < p->stp->first_changed_port) { p->stp->first_changed_port = p; } + seq_change(connectivity_seq_get()); } p->state = state; } @@ -1275,6 +1279,7 @@ stp_topology_change_detection(struct stp *stp) OVS_REQUIRES(mutex) } stp->fdb_needs_flush = true; stp->topology_change_detected = true; + seq_change(connectivity_seq_get()); VLOG_INFO_RL(&rl, "%s: detected topology change.", stp->name); }