struct {
LDAP *ld;
struct sockaddr_storage ss; /* the ip of the active connection, if any */
- time_t last_attempt; /* last attempt to reconnect */
+ time_t last_attempt; /* last attempt to reconnect, monotonic clock */
int port;
enum ads_saslwrap_type wrap_type;
char addr[INET6_ADDRSTRLEN];
ZERO_STRUCT(ads->ldap);
- ads->ldap.last_attempt = time(NULL);
+ ads->ldap.last_attempt = time_mono(NULL);
ads->ldap.wrap_type = ADS_SASLWRAP_TYPE_PLAIN;
/* try with a user specified server */
*res = NULL;
if (!ads->ldap.ld &&
- time(NULL) - ads->ldap.last_attempt < ADS_RECONNECT_TIME) {
+ time_mono(NULL) - ads->ldap.last_attempt < ADS_RECONNECT_TIME) {
return ADS_ERROR(LDAP_SERVER_DOWN);
}