[Python-checkins] cpython: #14758: Need to specify the desired socket type in the getaddrinfo call.
r.david.murray
python-checkins at python.org
Wed Jun 11 21:18:42 CEST 2014
http://hg.python.org/cpython/rev/d8e0fca7cbe3
changeset: 91136:d8e0fca7cbe3
user: R David Murray <rdmurray at bitdance.com>
date: Wed Jun 11 15:17:50 2014 -0400
summary:
#14758: Need to specify the desired socket type in the getaddrinfo call.
This worked by accident on Linux because the SOCK_STREAM was returned
first, but on the FreeBSD the SOCK_DGRAM is first in the list.
files:
Lib/smtpd.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Lib/smtpd.py b/Lib/smtpd.py
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -610,7 +610,8 @@
self._decode_data = decode_data
asyncore.dispatcher.__init__(self, map=map)
try:
- gai_results = socket.getaddrinfo(*localaddr)
+ gai_results = socket.getaddrinfo(*localaddr,
+ type=socket.SOCK_STREAM)
self.create_socket(gai_results[0][0], gai_results[0][1])
# try to re-use a server port if possible
self.set_reuse_addr()
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list