[Git][NTPsec/ntpsec][master] ntpclients/ntpdig.py: Fix a4361da5c84a8, bad test of bindaddr.

Gary E. Miller (@garyedmundsmiller) gitlab at mg.gitlab.com
Mon Apr 22 01:39:59 UTC 2024



Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
0f538b0a by Gary E. Miller at 2024-04-21T18:38:14-07:00
ntpclients/ntpdig.py: Fix a4361da5c84a8, bad test of bindaddr.

- - - - -


1 changed file:

- ntpclients/ntpdig.py


Changes:

=====================================
ntpclients/ntpdig.py
=====================================
@@ -90,7 +90,7 @@ def queryhost(server, concurrent, timeout=5, port=123, bindaddr=None):
     except socket.gaierror as e:
         log("lookup of %s failed, errno %d = %s" % (server, e.args[0], e.args[1]))
         return []
-    if len(bindaddr) > 0:
+    if bindaddr:
         try:
             bindsock = socket.getaddrinfo(bindaddr,None,af,
                                           socket.SOCK_DGRAM,socket.IPPROTO_UDP)
@@ -120,7 +120,7 @@ def queryhost(server, concurrent, timeout=5, port=123, bindaddr=None):
                     " %d, type %d could not be formed." %
                     (sockaddr[0], family, socktype))
             continue
-        if len(bindaddr) > 0:
+        if bindaddr:
             try:
                 if debug:
                     log("Binding to Source IP %s," % bindaddr)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/0f538b0a063aa7d2cab16f05de861efd636aa700

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/0f538b0a063aa7d2cab16f05de861efd636aa700
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/20240422/4ec60f13/attachment-0001.htm>


More information about the vc mailing list