[Git][NTPsec/ntpsec][master] Fix issue 763: ntpdig crashes connecting to 2.pool.ntp.org

Matt Selsky (@selsky) gitlab at mg.gitlab.com
Mon Mar 27 18:08:18 UTC 2023



Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
006b2c30 by James Browning at 2023-03-27T14:07:28-04:00
Fix issue 763: ntpdig crashes connecting to 2.pool.ntp.org

- - - - -


2 changed files:

- NEWS.adoc
- ntpclients/ntpdig.py


Changes:

=====================================
NEWS.adoc
=====================================
@@ -12,6 +12,9 @@ on user-visible changes.
 
 ## Repository Head
 
+* Fix ntpdig crash when using 2.ntp.pool.org
+  with a host without IPv6 support.
+
 * Do not install libaes_siv test anymore.
 
 * Add update option to buildprep.


=====================================
ntpclients/ntpdig.py
=====================================
@@ -101,7 +101,14 @@ def queryhost(server, concurrent, timeout=5, port=123):
             firstloop = False
         if debug:
             log("querying %s (%s)" % (sockaddr[0], server))
-        s = socket.socket(family, socktype)
+        try:
+            s = socket.socket(family, socktype)
+        except OSError:
+            if debug:
+                log("Skipping because socket for %s of family"
+                    " %d, type %d could not be formed." %
+                    (sockaddr[0], family, socktype))
+            continue
         if keyid and keytype and passwd:
             if debug:
                 log("authenticating with %s key %d" % (keytype, keyid))



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/006b2c30b738cf72c4b368e0c72f7d9f88ab8919

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/006b2c30b738cf72c4b368e0c72f7d9f88ab8919
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/20230327/f5f32c34/attachment-0001.htm>


More information about the vc mailing list