[Git][NTPsec/ntpsec][master] 2 commits: ntpdig: Only show socket error messages in debug

Matt Selsky (@selsky) gitlab at mg.gitlab.com
Tue Dec 6 03:07:43 UTC 2022



Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
a492cbaf by Richard Laager at 2022-12-06T03:01:23+00:00
ntpdig: Only show socket error messages in debug

This is a continuation on the changes from
commit 42ec668ddfb82606d5aea379cc74845084b10d15.

As in #680, these error messages are confusing to users who do not
have IPv6.  This came up again in:
https://bugs.debian.org/1020865

If all queries fail, the user still gets "ntpdig: no eligible servers",
so they aren't left wondering whether it worked or not.

- - - - -
c5ef18f9 by Richard Laager at 2022-12-06T03:01:23+00:00
ntpdig: Continue on errors in non-concurrent mode

In concurrent mode, select() errors were not fatal.  But in
non-concurrent mode, any error from select() would be fatal, even if
there was already a valid response received.

For example, I had a scenario where there was an A and AAAA returned
for a host (in that order).  The A worked but the AAAA did not.

This change makes the two code paths consistent.

- - - - -


1 changed file:

- ntpclients/ntpdig.py


Changes:

=====================================
ntpclients/ntpdig.py
=====================================
@@ -115,7 +115,8 @@ def queryhost(server, concurrent, timeout=5, port=123):
         try:
             s.sendto(packet, sockaddr)
         except socket.error as e:
-            log("socket error on transmission: %s" % e)
+            if debug:
+                log("socket error on transmission: %s" % e)
             continue
         if debug >= 2:
             log("Sent to %s:" % (sockaddr[0],))
@@ -124,9 +125,8 @@ def queryhost(server, concurrent, timeout=5, port=123):
             sockets.append(s)
         else:
             r, _, _ = select.select([s], [], [], timeout)
-            if not r:
-                return []
-            read_append(s, packets, packet, sockaddr)
+            if r:
+                read_append(s, packets, packet, sockaddr)
         while sockets:
             r, _, _ = select.select(sockets, [], [], timeout)
             if not r:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/2ac2880e6da8febe8dce07a1d0e3b2aa58352241...c5ef18f951f4638f34edd1cc82241eafa87f0a07

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/2ac2880e6da8febe8dce07a1d0e3b2aa58352241...c5ef18f951f4638f34edd1cc82241eafa87f0a07
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/20221206/04f9a146/attachment-0001.htm>


More information about the vc mailing list