A Config BPDU always conveys a Designated Port Role. Signed-off-by: Daniele Venturino <daniele.ventur...@m3s.it> --- lib/rstp-state-machines.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/lib/rstp-state-machines.c b/lib/rstp-state-machines.c index 13abec0..516093f 100644 --- a/lib/rstp-state-machines.c +++ b/lib/rstp-state-machines.c @@ -1026,8 +1026,13 @@ rcv_info(struct rstp_port *p) cp = compare_rstp_priority_vectors(&p->msg_priority, &p->port_priority); ct = rstp_times_equal(&p->port_times, &p->msg_times); - role = - (p->received_bpdu_buffer.flags & ROLE_FLAG_MASK) >> ROLE_FLAG_SHIFT; + /* Configuration BPDU conveys a Designated Port Role. */ + if (p->received_bpdu_buffer.bpdu_type == CONFIGURATION_BPDU) { + role = PORT_DES; + } else { + role = + (p->received_bpdu_buffer.flags & ROLE_FLAG_MASK) >> ROLE_FLAG_SHIFT; + } /* 802.1D-2004 does not report this behaviour. * 802.1Q-2008 says set rcvdTcn. */ @@ -1047,9 +1052,7 @@ rcv_info(struct rstp_port *p) * 17.19.22). * NOTE: Configuration BPDU explicitly conveys a Designated Port Role. */ - if ((role == PORT_DES - || p->received_bpdu_buffer.bpdu_type == CONFIGURATION_BPDU) - && (cp == SUPERIOR || (cp == SAME && ct == false))) { + if (role == PORT_DES && (cp == SUPERIOR || (cp == SAME && ct == false))) { return SUPERIOR_DESIGNATED_INFO; /* Returns RepeatedDesignatedInfo if: -- 1.8.1.2 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev