From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EPs7E/ahKGC0RwAA0tVLHw (envelope-from ) for ; Sun, 14 Feb 2021 04:07:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id OAQFD/ahKGDtRAAAB5/wlQ (envelope-from ) for ; Sun, 14 Feb 2021 04:07:18 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6E0501CF69 for ; Sun, 14 Feb 2021 05:07:16 +0100 (CET) Received: from localhost ([::1]:46626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lB8gj-0005dm-Ow for larch@yhetil.org; Sat, 13 Feb 2021 23:07:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lB8gZ-0005da-3T for bug-guix@gnu.org; Sat, 13 Feb 2021 23:07:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:52035) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lB8gY-0000iH-SE for bug-guix@gnu.org; Sat, 13 Feb 2021 23:07:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lB8gY-0006wc-5w for bug-guix@gnu.org; Sat, 13 Feb 2021 23:07:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#46481: "guix download" with ftp URL doesn't work on IPv6 network Resent-From: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 14 Feb 2021 04:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46481 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Danny Milosavljevic Received: via spool by 46481-submit@debbugs.gnu.org id=B46481.161327561026674 (code B ref 46481); Sun, 14 Feb 2021 04:07:02 +0000 Received: (at 46481) by debbugs.gnu.org; 14 Feb 2021 04:06:50 +0000 Received: from localhost ([127.0.0.1]:35348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lB8gM-0006wA-BK for submit@debbugs.gnu.org; Sat, 13 Feb 2021 23:06:50 -0500 Received: from mail-oln040092254035.outbound.protection.outlook.com ([40.92.254.35]:10984 helo=APC01-PU1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lB8gI-0006vv-P9 for 46481@debbugs.gnu.org; Sat, 13 Feb 2021 23:06:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mAfkMVpW+DryY6zJUrp2ZRvVRU84AQwe+WHKRMcEMvTMJNjPcTqxGZXC7ehqcgdsRVaqBWXiR6thE9X0moJ18F8ZYjEETxNDA4qmgLT3wRjosl/aYNjTbj+AmX8UobrK+4E+j3DDJXv0Qn61tuP0ANa8ggTTJCn4LzLi527Wd0P/CCU0t9h6aPMM5sx8BisvqkfUTguvBtlKKOQTx/4z7eDA4mleGOfPNLRtpmzhxgKIgPuTE5uSgtqF/ozbSl14UwC5C0GtsJdsTLDJQMW/3YzvkpGec9fu8Yo79ETTddbOjaCZxAfJ58p+ftfmhe+NLnsOhXbn+VwJS1X+sgeU3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LhHgWsWTR/h5fw7sg8a3i9hea4rpX4HGMgwfn5U3gnY=; b=H3Q2dp5N0v5qXPtUHNmwaxPf6zMBgT0Td6PozNl073+W/JCdTHWiL9x9wueu/dKmVmZ5CNQN11S8+otDvX9VCFdz1AufCO1FN34ffqXEVEjNmg7GQqruDH6B+nfdDp76bvdHfzR2Cb4neL2jUe6mijkDv6Yuow5+n07e7MPYiZj6hyKnn63MGhNwdUrP5PXsZpSH+qXUTMrVKVR2Y8l1IweXBv36QUUIJofxzjJ8V7fQ4C5t65xO9mFia44Lm50Hi2ApyG//0rKwgas74bNaq3k2JB/8bri/FIGjvQ9mWVa33b33Mw4DwSeug/eauZzzMBWHxIH/h5glsqQHBcUuBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LhHgWsWTR/h5fw7sg8a3i9hea4rpX4HGMgwfn5U3gnY=; b=K4r5qfIDCUtx6pMxqNe0pRVSu5z6MRiW8sjLaubtvuOIlgheeM3pIpP7vYqAextVH0TxsmhMLzkqBFqYDaYippmGL4EoB8EmCyPmtJwqBRrssZ7Qv3xZNf+KVu1LfZUtyF4WqmOHIP6ZbizUlu7lI44gjB/VV+6EBho76ijXY3BW1ygommu3T7uqdxHBjQgKRN6RXUaoGgBj3dBtqW1JdWpxxwodlfQy+dwERAhHynS+3Eej53QNXmEAABd6JV2+OUzjIjT0VGuoxshanPV5DS+fLVh4/hmp3ZL9iocHgdlJXVaYKVkCUoXVWz5D1rovJ4XPLZBX5N0ZEuOWQob1sQ== Received: from SG2APC01FT030.eop-APC01.prod.protection.outlook.com (2a01:111:e400:7ebd::52) by SG2APC01HT009.eop-APC01.prod.protection.outlook.com (2a01:111:e400:7ebd::197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25; Sun, 14 Feb 2021 04:06:28 +0000 Received: from OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM (10.152.250.58) by SG2APC01FT030.mail.protection.outlook.com (10.152.250.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Sun, 14 Feb 2021 04:06:28 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:AA4E18A870D74A96F6C77D0B703D0EBDBB815E8EDB87F64A07B9B7F0D4B69043; UpperCasedChecksum:826C3044FF45FD18D39689F7042D69229496B0534BE6F66054C4CB29BBDF0E52; SizeAsReceived:7542; Count:46 Received: from OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM ([fe80::4987:bbf2:2bff:6b22]) by OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM ([fe80::4987:bbf2:2bff:6b22%5]) with mapi id 15.20.3846.039; Sun, 14 Feb 2021 04:06:28 +0000 From: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= References: <20210213033522.0196ffcf@scratchpost.org> Date: Sun, 14 Feb 2021 12:08:09 +0800 In-Reply-To: <20210213033522.0196ffcf@scratchpost.org> (Danny Milosavljevic's message of "Sat, 13 Feb 2021 03:35:57 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [zkObiTjscdBDLa3+/hK8gkWo7Oypv0aWveh+N/tt5bbFTyk94OtVTE+S4Bhqlbkp] X-ClientProxiedBy: FRYP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::27) To OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:ec::11) X-Microsoft-Original-Message-ID: <87eehjuw9i.fsf@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost (2409:8a62:378:f4a0:2f1:f5ff:fe18:6bb) by FRYP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.12 via Frontend Transport; Sun, 14 Feb 2021 04:06:26 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 16a2e6a3-d541-42d2-68da-08d8d09de715 X-MS-TrafficTypeDiagnostic: SG2APC01HT009: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S2cRhQvasafcoqdbhlWswgU9vNq/eErh5lgoPXQIV6oX49A6W9SAym/pIzIn8xiRN124F4qhBbsBV3H6epmv9BU8wHAfXuiFUecejCF4jI0CII0m5HzvMIuVjE6SyiWi/4H77ORYg6qIykjDVTXUjB74EALxs55V1P+wHXdhdh6nalYgYXdXoN6p7K5z6xoxbzO9zLnO3bLHG/kltvXcklxa+LIKTZdXg4F3t4l67UMkNdxpK2lwUj6ab+ZvFi0M+psyoG76Xgn5RAphl9hON2RKwEBog6+BPyrrq/YgMljXzeeQ654p5m3ltc7NrgisTZ1fd3127lrojPUIEq2f7jEoQNG0V8gqd3Au2moMnyJN4GRsCJTars3B2SfwMXlupQRHQcNQWYFc2qJKp24NbwhCdkA0piEQyM3U+nNdv1w= X-MS-Exchange-AntiSpam-MessageData: llJgzHqg6/xL2KWw389sMtERtfKID4qf6k8tRdRiLTVWecAJ4LWKgenryq0w174Xk4Pv7VJnwBczSKfvBxIUd5KyfsByBivvE1s4kINmDFl6ZoupXzHIS0CHqvTRA9cF4rzdL9G1IJ8t6LDvdd1DCbQemyp3fp7U2L7HEsBeJtSxPN9UGVnxxB0eYcLNsv0hUgUOzR78Tpk9q8oWogwPDw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16a2e6a3-d541-42d2-68da-08d8d09de715 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2021 04:06:28.3943 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: SG2APC01FT030.eop-APC01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2APC01HT009 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 46481@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 0.74 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=outlook.com header.s=selector1 header.b=K4r5qfID; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed)" header.from=outlook.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 6E0501CF69 X-Spam-Score: 0.74 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3hFdX6i7LNPo --=-=-= Content-Type: text/plain Danny Milosavljevic writes: > I strongly suspect there to be some problem with the ftp client since > that's the second file that doesn't work using guix download but does work > using wget, on the same computer. > > $ guix download ftp://ftp.denx.de/pub/u-boot/u-boot-2021.01.tar.bz2 > > Starting download of /tmp/guix-file.tORPhj > From ftp://ftp.denx.de/pub/u-boot/u-boot-2021.01.tar.bz2... > Throw to key `ftp-error' with args `(# "PASV" 425 "You cannot use PASV on IPv6 connections. Use EPSV instead.\r")'. > failed to download "/tmp/guix-file.tORPhj" from "ftp://ftp.denx.de/pub/u-boot/u-boot-2021.01.tar.bz2" > guix download: error: ftp://ftp.denx.de/pub/u-boot/u-boot-2021.01.tar.bz2: download failed Yes, with this patch I can get it work: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ftp-client-Before-PASV-try-EPSV-first-for-IPv6.patch >From 568ea9cc0e07eab24c7d24e228d7d391f191feca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Sun, 14 Feb 2021 12:02:57 +0800 Subject: [PATCH] ftp-client: Before 'PASV', try 'EPSV' first for IPv6. This fixes . * guix/ftp-client.scm (ftp-epsv, ftp-passive): New procedure. (ftp-list, ftp-retr): Replace call to 'ftp-pasv' with 'ftp-passive'. --- guix/ftp-client.scm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/guix/ftp-client.scm b/guix/ftp-client.scm index 8d5adcb8ed..a72057d3f5 100644 --- a/guix/ftp-client.scm +++ b/guix/ftp-client.scm @@ -216,6 +216,19 @@ TIMEOUT, an ETIMEDOUT error is raised." (else (throw 'ftp-error conn "PASV" 227 message))))) +(define (ftp-epsv conn) + (let* ((message (%ftp-command "EPSV" 229 (ftp-connection-socket conn)))) + (string->number + (match:substring + (string-match "\\(...([0-9]+).\\)" message) 1)))) + +(define (ftp-passive conn) + "Enter passive mode using EPSV or PASV, return a data connection port on +success." + ;; IPv6 only works with EPSV, so try it first. + (or (false-if-exception (ftp-epsv conn)) + (ftp-pasv conn))) + (define (address-with-port sa port) "Return a socket-address object based on SA, but with PORT." (let ((fam (sockaddr:fam sa)) @@ -232,7 +245,7 @@ TIMEOUT, an ETIMEDOUT error is raised." (if directory (ftp-chdir conn directory)) - (let* ((port (ftp-pasv conn)) + (let* ((port (ftp-passive conn)) (ai (ftp-connection-addrinfo conn)) (s (socket (addrinfo:fam ai) (addrinfo:socktype ai) (addrinfo:protocol ai)))) @@ -281,7 +294,7 @@ must be closed before CONN can be used for other purposes." ;; Ask for "binary mode". (%ftp-command "TYPE I" 200 (ftp-connection-socket conn)) - (let* ((port (ftp-pasv conn)) + (let* ((port (ftp-passive conn)) (ai (ftp-connection-addrinfo conn)) (s (with-fluids ((%default-port-encoding #f)) (socket (addrinfo:fam ai) (addrinfo:socktype ai) -- 2.30.0 --=-=-= Content-Type: text/plain Okay to push? --=-=-=--