Skip to content

Commit

Permalink
Correct addrs sorting to be by TCP/UDP
Browse files Browse the repository at this point in the history
Fixes any potential cases where the resolver might yield UDP addresses
first.

Signed-off-by: Robbie Harwood <[email protected]>
  • Loading branch information
frozencemetery committed Aug 28, 2019
1 parent 58b3676 commit d0b35c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kdcproxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def __call__(self, env, start_response):
#
# Stick a None address on the end so we can get one
# more attempt after all servers have been contacted.
addrs = tuple(sorted(filter(self.__filter_addr, addrs)))
addrs = tuple(sorted(filter(self.__filter_addr, addrs),
key=lambda a: a[2]))
for addr in addrs + (None,):
if addr is not None:
# Bypass unspecified socktypes
Expand Down

0 comments on commit d0b35c2

Please sign in to comment.