From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 4BF8F1F4C0 for ; Thu, 31 Oct 2019 19:02:56 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 54304120A48; Fri, 1 Nov 2019 04:02:45 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 730DF120A43 for ; Fri, 1 Nov 2019 04:02:43 +0900 (JST) Received: by filter0039p3iad2.sendgrid.net with SMTP id filter0039p3iad2-2395-5DBB2FD6-8F 2019-10-31 19:02:46.494356182 +0000 UTC m=+243940.302959612 Received: from herokuapp.com (unknown [54.210.198.90]) by ismtpd0059p1iad1.sendgrid.net (SG) with ESMTP id wWVlCuuDTR6p4BNHKHxO2w for ; Thu, 31 Oct 2019 19:02:46.376 +0000 (UTC) Date: Thu, 31 Oct 2019 19:02:46 +0000 (UTC) From: merch-redmine@jeremyevans.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 71209 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 10911 X-Redmine-Issue-Author: postmodern X-Redmine-Issue-Assignee: knu X-Redmine-Sender: jeremyevans0 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-SG-EID: =?us-ascii?Q?RVE3t853K5scBhbmJHUzZTFFeVC=2FZSUmHZ0Dc+26wcEi2CTgsF1oz0wTSSxGGN?= =?us-ascii?Q?BIMhaNAhh6mDjVPH4E+g3M3=2FnyfZpJBzY9kB6gf?= =?us-ascii?Q?p5NLfhwXaDW+ITsH1hdfA44xZz4QWqBrY1N0SzI?= =?us-ascii?Q?7SHMh5uJw3z1dt1YQwA0Zf2tlUsSC6rCIyXX=2Fr2?= =?us-ascii?Q?=2FU2FQ=2FI6uBk75cIfWZOLV0j=2FRKiqhTOKOpw=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95615 Subject: [ruby-core:95615] [Ruby master Feature#10911] IPAddr.new should ignore zone identifiers X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #10911 has been updated by jeremyevans0 (Jeremy Evans). Dan0042 (Daniel DeLorme) wrote: > So "fe80::1%fxp0" is not even recognized as an IP address. This could result in unpleasantness in cases like this: > > ```ruby > str = "fe80::1%fxp0" > ip = IPAddr.new(str) rescue nil #validate IP address > TCPSocket.new(ip.to_s, 42) if ip #and connect > ``` Good point. We would probably want to fix socket to support this before adding support to ipaddr. I think it is reasonable for socket to support it, as tools dealing with IPv6 should handle zone identifiers. I tried ping6 and traceroute6: ``` $ ping6 fe80::1%lo0 PING fe80::1%lo0 (fe80::1%lo0): 56 data bytes 64 bytes from fe80::1%lo0: icmp_seq=0 hlim=64 time=0.630 ms $ traceroute6 fe80::1 traceroute6 to fe80::1%lo (fe80::1%lo0), 64 hops max, 60 byte packets 1 fe80::1%lo0 (fe80::1%lo0) 0.162 ms 0.098 ms 0.091 ms ``` Ignoring the zone identifier is not valid: ``` $ ping6 fe80::1 PING fe80::1 (fe80::1): 56 data bytes ping6: sendmsg: Network is unreachable $ traceroute6 fe80::1 traceroute6 to fe80::1 (fe80::1), 64 hops max, 60 byte packets traceroute6: sendto: Network is unreachable ``` ---------------------------------------- Feature #10911: IPAddr.new should ignore zone identifiers https://bugs.ruby-lang.org/issues/10911#change-82406 * Author: postmodern (Hal Brodigan) * Status: Assigned * Priority: Normal * Assignee: knu (Akinori MUSHA) * Target version: ---------------------------------------- Link local IPv6 addresses may have a zone identifier suffix: fe80::1%lo0 IPAddr.new currently does not ignore the zone identifier and raises IPAddr::InvalidAddressError. ---Files-------------------------------- ipaddr-ipv6-zone-id-10911.patch (5.17 KB) -- https://bugs.ruby-lang.org/