diff --git a/ssnet.py b/ssnet.py index 2abf5d0..a987562 100644 --- a/ssnet.py +++ b/ssnet.py @@ -124,6 +124,12 @@ class SockWrapper: return # already connected self.rsock.setblocking(False) debug3('%r: trying connect to %r\n' % (self, self.connect_to)) + if socket.inet_aton(self.connect_to[0])[0] == '\0': + self.seterr(Exception("Can't connect to %r: " + "IP address starts with zero\n" + % (self.connect_to,))) + self.connect_to = None + return try: self.rsock.connect(self.connect_to) # connected successfully (Linux)