Blame SOURCES/Correct-addrs-sorting-to-be-by-TCP-UDP.patch

52ae74
From 5cfde6d085320da3fb5d4c6506e6d6253438669c Mon Sep 17 00:00:00 2001
52ae74
From: Robbie Harwood <rharwood@redhat.com>
52ae74
Date: Fri, 2 Aug 2019 13:54:05 -0400
52ae74
Subject: [PATCH] Correct addrs sorting to be by TCP/UDP
52ae74
52ae74
Fixes any potential cases where the resolver might yield UDP addresses
52ae74
first.
52ae74
52ae74
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
52ae74
(cherry picked from commit d0b35c2b71a172f409b4311d36538d8fa3433c58)
52ae74
---
52ae74
 kdcproxy/__init__.py | 3 ++-
52ae74
 1 file changed, 2 insertions(+), 1 deletion(-)
52ae74
52ae74
diff --git a/kdcproxy/__init__.py b/kdcproxy/__init__.py
52ae74
index c59f2b3..6526bc9 100644
52ae74
--- a/kdcproxy/__init__.py
52ae74
+++ b/kdcproxy/__init__.py
52ae74
@@ -227,7 +227,8 @@ class Application:
52ae74
                 #
52ae74
                 # Stick a None address on the end so we can get one
52ae74
                 # more attempt after all servers have been contacted.
52ae74
-                addrs = tuple(sorted(filter(self.__filter_addr, addrs)))
52ae74
+                addrs = tuple(sorted(filter(self.__filter_addr, addrs),
52ae74
+                                     key=lambda a: a[2]))
52ae74
                 for addr in addrs + (None,):
52ae74
                     if addr is not None:
52ae74
                         # Bypass unspecified socktypes