From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [IPv6:2a01:4f8:1c0c:6b10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id A5E181F44D for ; Wed, 3 Apr 2024 02:35:33 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=KJWGt3S4; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=kp+LpU22; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 2093483B73; Wed, 3 Apr 2024 02:35:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1712111726; bh=NyK9UgbrMvy5PcOdNHFq6Qxv5TzgPqOe286eBtyI4F0=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=KJWGt3S4azGf750WwWdnFkB8ZUHvxptZ2RBK5A/TFY2iO9bNMY33mgC2M9T2dEv9B LTb6Dyzzr1Sc0WvzgVTCGutIRl+EjgSvnSMBCXx71NMOkGEsSmAWo8+aumkEPY7SOT g9yJkldj/2XPdsHgW0fJA9/vOeSolQVfDo+PLROY= Received: from s.wfbtzhsv.outbound-mail.sendgrid.net (s.wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 5D46783B30 for ; Wed, 3 Apr 2024 02:35:23 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=kp+LpU22; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=ulEG0uB0Z51ngPX+WBkPJCWVoln95iuC+uuTBe23qk0=; b=kp+LpU22w9gVTIanbEwJ08HN66k44A0V2iiWwN+2d+0gozUTsY+LCv1DcLblVMX3DECF p6/hcXd8iGKKTON0vTRn47JRq2emdW1FBRqnGVBuY6AtIq99Cvmb6F9aFLkxX/L0PB8tVs VIEmhqDvoCPifZuml32lkyTw7dZOif8V4gAgpnnbUQNH76RjH+yGYVS2nE0sPbRGiDh5Y2 830J+wthA2oCsmd9DSp3geIuvZUilun4Z70A5pjX2+dap9Jn4pyBA4UZbKZ5/zhVP5pEdf 8zAOJDdQOilplr/onQwYa7IDKgC/Sc0cI6xBB5+dDT6dtXHPSlpH2TQ5O2csVrUA== Received: by recvd-6fc499775c-wzrrk with SMTP id recvd-6fc499775c-wzrrk-1-660CC06A-5 2024-04-03 02:35:22.495520422 +0000 UTC m=+1316099.195538137 Received: from herokuapp.com (unknown) by geopod-ismtpd-39 (SG) with ESMTP id RW5vy_wsSPKAtesoMjMbiw for ; Wed, 03 Apr 2024 02:35:22.457 +0000 (UTC) Date: Wed, 03 Apr 2024 02:35:22 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 15628 X-Redmine-Issue-Author: sonalkr132 X-Redmine-Issue-Assignee: Glass_saga X-Redmine-Issue-Priority: Normal X-Redmine-Sender: hsbt X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 94006 X-SG-EID: =?us-ascii?Q?u001=2ESNtsfy=2FRYrUmxOeGSN+Ah1new64UppKFg8YOAgra6KK6sIhqEP6LswYh4?= =?us-ascii?Q?tCf2AhAD20FCmXanLCSpdJ9Heq83FKB1eeA=2FIRz?= =?us-ascii?Q?=2FUFVHcMb3GO9cb7MRPmYAszxctD2fxKLP6OHWXj?= =?us-ascii?Q?bReHxgqNLcDH4j5PM7I=2F+zhSBksnDlN0LUMmcpE?= =?us-ascii?Q?72T6cgwZaNzjfJG+6=2FoOOT5V+dwC45abGmFBu1D?= =?us-ascii?Q?NTHdIw4pKGXQwIejFSfPBBK8VTx00i+4=2FTfsuRr?= =?us-ascii?Q?YYvwcIpRAkM22wCd7=2F7It0PTYA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: RXPCHSSZDVV2POSKYEO6TDY2AN6F5HGA X-Message-ID-Hash: RXPCHSSZDVV2POSKYEO6TDY2AN6F5HGA X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:117411] [Ruby master Feature#15628] init_inetsock_internal should fallback to IPv4 if IPv6 is unreachable List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "hsbt (Hiroshi SHIBATA) via ruby-core" Cc: "hsbt (Hiroshi SHIBATA)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #15628 has been updated by hsbt (Hiroshi SHIBATA). Status changed from Assigned to Closed Closing in favor of https://bugs.ruby-lang.org/issues/20108 ---------------------------------------- Feature #15628: init_inetsock_internal should fallback to IPv4 if IPv6 is unreachable https://bugs.ruby-lang.org/issues/15628#change-107588 * Author: sonalkr132 (Aditya Prakash) * Status: Closed * Assignee: Glass_saga (Masaki Matsushita) ---------------------------------------- Hi, This is not really bug but more of a missing feature. Let me layout steps to reproduce what I am trying to achieve: * Add local entries for `example.com` ``` $ echo "::1 example.com www.example.com 127.0.0.1 example.com www.example.com" | sudo tee --append /etc/hosts ``` * Add rule to `DROP` ipv6 packets: `sudo ip6tables -P INPUT DROP` * Start a server: `ruby -rwebrick -e 'WEBrick::HTTPServer.new(Port: 8000).start'` * Making request using Net:HTTP with timeout (`Net::OpenTimeout`) after after 60 seconds: `ruby -rnet/http -e "Net::HTTP.get(URI('http://example.com:8000'))"` As far as I understand, [init_inetsock_internal](https://github.com/ruby/ruby/blob/4444025d16ae1a586eee6a0ac9bdd09e33833f3c/ext/socket/ipsocket.c#L42) needs to fallback to ipv4 for Net::HTTP.get to work. IPv6 route being broke is expected and hence, [RFC8305](https://tools.ietf.org/html/rfc8305) recommends fallback to IPv4. Support for IPv6 fallback is spotty across languages and http clients, for example, [golang supports it](https://github.com/golang/go/blob/master/src/net/dial.go#L47) but python doesn't, making request with `curl` works but `wget` hangs. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/