aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--socket.c17
2 files changed, 18 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 3a6bd86e..b7ba4fea 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@
* Grant Edwards's patch to correct NTLM behavior.
* In IMAP, set Seen flag explicity when keep is on; works around flaky
servers that don't set Seen on a body fetch.
+* James Bristers fix for IP-address hostnames.
fetchmail-5.1.2 (Thu Oct 7 09:46:07 EDT 1999), 17906 lines:
* Joe Loughry <loughry@uswest.net> sent a patch to handle multihomed machines.
diff --git a/socket.c b/socket.c
index 058fe2d5..db0d7000 100644
--- a/socket.c
+++ b/socket.c
@@ -248,6 +248,23 @@ int SockOpen(const char *host, int clientPort, const char *options,
errno = olderr;
return -1;
}
+ } else {
+ ad.sin_port = htons(clientPort);
+
+ sock = socket(AF_INET, SOCK_STREAM, 0);
+ if (sock < 0)
+ {
+ h_errno = 0;
+ return -1;
+ }
+ if (connect(sock, (struct sockaddr *) &ad, sizeof(ad)) < 0)
+ {
+ int olderr = errno;
+ close(sock);
+ h_errno = 0;
+ errno = olderr;
+ return -1;
+ }
}
return(sock);
}