stp: Make stp-disabled port forward stp bpdu packets.
[cascardo/ovs.git] / lib / stp.c
index dbe48e8..1d395f3 100644 (file)
--- a/lib/stp.c
+++ b/lib/stp.c
@@ -684,13 +684,18 @@ stp_learn_in_state(enum stp_state state)
     return (state & (STP_DISABLED | STP_LEARNING | STP_FORWARDING)) != 0;
 }
 
-/* Returns true if 'state' is one in which rx&tx bpdu should be done on
- * on a port, false otherwise. */
+/* Returns true if 'state' is one in which bpdus should be forwarded on a
+ * port, false otherwise.
+ *
+ * Returns true if 'state' is STP_DISABLED, since in that case the port does
+ * not generate the bpdu and should just forward it (e.g. patch port on pif
+ * bridge). */
 bool
-stp_listen_in_state(enum stp_state state)
+stp_should_forward_bpdu(enum stp_state state)
 {
     return (state &
-            (STP_LISTENING | STP_LEARNING | STP_FORWARDING)) != 0;
+            ( STP_DISABLED | STP_LISTENING | STP_LEARNING
+              | STP_FORWARDING)) != 0;
 }
 
 /* Returns the name for the given 'role' (for use in debugging and log