OSDN Git Service

Fix bugs of routines for IPv6.
[ffftp/ffftp.git] / connect.c
index 38284b1..989c026 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -2492,14 +2492,14 @@ SOCKET GetFTPListenSocketIPv6(SOCKET ctrl_skt, int *CancelCheckWork)
 \r
        if(listen_skt != INVALID_SOCKET)\r
        {\r
-#define  US(w)  (((int)w)&0xffff)\r
+#define  UC(b)  (((int)b)&0xff)\r
                // 同時接続対応\r
 //             if((command(ctrl_skt,NULL, &CancelFlg, "PORT %d,%d,%d,%d,%d,%d",\r
 //                             UC(a[0]), UC(a[1]), UC(a[2]), UC(a[3]),\r
 //                             UC(p[0]), UC(p[1])) / 100) != FTP_COMPLETE)\r
                if((command(ctrl_skt,NULL, CancelCheckWork, "EPRT |2|%s|%d|",\r
                                AddressToStringIPv6(Adrs, a),\r
-                               US(p[0])) / 100) != FTP_COMPLETE)\r
+                               (UC(p[0]) << 8) | UC(p[1])) / 100) != FTP_COMPLETE)\r
                {\r
                        SetTaskMsg(MSGJPN031);\r
                        do_closesocket(listen_skt);\r