rstp-state-machines: fix TCN reception.
authorDaniele Venturino <daniele.venturino@m3s.it>
Fri, 14 Nov 2014 22:07:50 +0000 (14:07 -0800)
committerJarno Rajahalme <jrajahalme@nicira.com>
Fri, 14 Nov 2014 22:07:50 +0000 (14:07 -0800)
Set rcdv_tcn and return OTHER_INFO when a
TOPOLOGY_CHANGE_NOTIFICATION_BPDU is received, as required by
802.1Q-2008.

Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
lib/rstp-state-machines.c

index e2d6e76..7f8a632 100644 (file)
@@ -1032,6 +1032,14 @@ rcv_info(struct rstp_port *p)
     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. */
+    if (p->received_bpdu_buffer.bpdu_type ==
+            TOPOLOGY_CHANGE_NOTIFICATION_BPDU) {
+        p->rcvd_tcn = true;
+        return OTHER_INFO;
+    }
+
     /* Returns SuperiorDesignatedInfo if:
      * a) The received message conveys a Designated Port Role, and
      *  1) The message priority is superior (17.6) to the Port.s port priority