[Git][NTPsec/ntpsec][master] ntpsweep: fix crash dump on Python 2.6.
Gary E. Miller
gitlab at mg.gitlab.com
Tue Sep 26 22:03:33 UTC 2017
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
8871e54c by Gary E. Miller at 2017-09-26T15:02:47-07:00
ntpsweep: fix crash dump on Python 2.6.
Gracefully handle errno 111 'Connection refused'.
- - - - -
1 changed file:
- pylib/packet.py
Changes:
=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -1066,7 +1066,12 @@ class ControlSession:
raise ControlException(SERR_INCOMPLETE)
warndbg("At %s, socket read begins\n" % time.asctime(), 4)
- rawdata = polybytes(self.sock.recv(4096))
+ try:
+ rawdata = polybytes(self.sock.recv(4096))
+ except socket.error:
+ # usually, errno 111: connection refused
+ raise ControlException(SERR_UNSPEC)
+
warndbg("Received %d octets\n" % len(rawdata), 3)
rpkt = ControlPacket(self)
try:
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8871e54c98d1cb0f8912359024abb49d61af67a4
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8871e54c98d1cb0f8912359024abb49d61af67a4
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170926/37bb2dfe/attachment.html>
More information about the vc
mailing list