summaryrefslogtreecommitdiff
path: root/Lib/smtpd.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-06-11 15:17:50 -0400
committerR David Murray <rdmurray@bitdance.com>2014-06-11 15:17:50 -0400
commit012a83ab261f7b0357e9c29c9022315ab9c7d970 (patch)
treeed61a03826030a79a84a121928c7f4b751a7ff42 /Lib/smtpd.py
parent6ffface4293f20e504de6a7ca012c482a203409d (diff)
downloadcpython-git-012a83ab261f7b0357e9c29c9022315ab9c7d970.tar.gz
#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.
Diffstat (limited to 'Lib/smtpd.py')
-rwxr-xr-xLib/smtpd.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/smtpd.py b/Lib/smtpd.py
index d828c5f12f..f90fae8e15 100755
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -610,7 +610,8 @@ class SMTPServer(asyncore.dispatcher):
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()