X-Mailer: MIME-tools 5.508 (Entity 5.508) Content-Type: text/plain; charset="utf-8" References: Message-ID: X-RT-Original-Encoding: utf-8 Content-Transfer-Encoding: binary MIME-Version: 1.0 In-Reply-To: Content-Disposition: inline X-RT-Interface: Web RT-Send-CC: Content-Length: 1623 > diff --git a/bin/tests/system/chain/ans4/ans.py b/bin/tests/system/chain/ans4/ans.py > index 80c519c382..36e1e7e314 100755 > --- a/bin/tests/system/chain/ans4/ans.py > +++ b/bin/tests/system/chain/ans4/ans.py > @@ -270,8 +270,17 @@ sock = 5300 > > query4_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) > query4_socket.bind((ip4, sock)) > -query6_socket = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) > -query6_socket.bind((ip6, sock)) > + > +havev6 = 1 "havev6" is a boolean flag, we should use True/False for its values. (Same for "running", BTW.) > +try: > + query6_socket = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) > + try: > + query6_socket.bind((ip6, sock)) > + except: > + query6_socket.close() > + havev6 = 0 Is there any practical _IPv6-specific_ scenario that you have come across in which creating a socket succeeds, but bind() fails? While I appreciate the attempt to handle errors gracefully, this causes IPv6 socket errors to be treated differently than IPv4 socket errors. I would either apply the same logic to IPv4 sockets or drop this inner try-except completely (with preference for the latter; this is test code, so I would rather see it fail hard under suspicious conditions than cover them up by trying to behave nicely). > +except: I would limit this to socket.error exceptions. (I am aware Python 3.3+ raises OSError instead, but we already use socket.error elsewhere in this script and socket.error is currently aliased to OSError in newer Python versions.) Looks good otherwise. I also verified that it does what it claims to.