wininet(9/10): Fail in FTP if the resolved name is not an IPv4 address

Juan Lang juan.lang at gmail.com
Thu Jul 9 14:01:25 CDT 2009


The reason for failing, rather than supporting IPv6 addresses, is that
the protocol needs to be modified to support the EPRT and EPSV
commands (RFC 2428) in order to support IPv6.  This is a bit beyond
the scope of this patch series.
--Juan
-------------- next part --------------
From b36c2b8a6d6f348262ef6a42c7004fba47e4165a Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Thu, 9 Jul 2009 11:45:48 -0700
Subject: [PATCH 13/14] Fail in FTP if the resolved name is not an IPv4 address

---
 dlls/wininet/ftp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index 6d41ac5..dce18bb 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -2450,6 +2450,12 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
     SendAsyncCallback(&hIC->hdr, dwContext, INTERNET_STATUS_NAME_RESOLVED,
         (LPWSTR) lpszServerName, strlenW(lpszServerName));
 
+    if (socketAddr.sin_family != AF_INET)
+    {
+        WARN("unsupported address family %d\n", socketAddr.sin_family);
+        INTERNET_SetLastError(ERROR_INTERNET_CANNOT_CONNECT);
+        goto lerror;
+    }
     nsocket = socket(AF_INET,SOCK_STREAM,0);
     if (nsocket == -1)
     {
-- 
1.6.3.2


More information about the wine-patches mailing list