Skip to content

Commit aa832c5

Browse files
authored
Merge pull request Pennyw0rth#606 from jdholtz/ldap-timeout
Silently handle connection timed out during LDAP scan
2 parents da8ef0f + 0aeb105 commit aa832c5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import hashlib
44
import hmac
55
import os
6-
from errno import EHOSTUNREACH
6+
from errno import EHOSTUNREACH, ETIMEDOUT, ENETUNREACH
77
from binascii import hexlify
88
from datetime import datetime
99
from re import sub, I
@@ -211,7 +211,7 @@ def create_conn_obj(self):
211211
self.logger.debug(f"{e} on host {self.host}")
212212
return False
213213
except OSError as e:
214-
if e.errno == EHOSTUNREACH:
214+
if e.errno in (EHOSTUNREACH, ENETUNREACH, ETIMEDOUT):
215215
self.logger.info(f"Error connecting to {self.host} - {e}")
216216
return False
217217
else:

0 commit comments

Comments
 (0)