lacp: New function lacp_slave_is_current().
[sliver-openvswitch.git] / lib / lacp.c
index ee79677..9b3b14b 100644 (file)
@@ -269,6 +269,15 @@ lacp_slave_get_port_id(const struct lacp *lacp, const void *slave_)
     return slave->port_id;
 }
 
+/* Returns true if partner information on 'slave_' is up to date.  'slave_'
+ * not being current, generally indicates a connectivity problem, or a
+ * misconfigured (or broken) partner. */
+bool
+lacp_slave_is_current(const struct lacp *lacp, const void *slave_)
+{
+    return slave_lookup(lacp, slave_)->status == LACP_CURRENT;
+}
+
 /* This function should be called periodically to update 'lacp'. */
 void
 lacp_run(struct lacp *lacp, lacp_send_pdu *send_pdu)