From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 22A083858D39; Sat, 1 Jul 2023 20:57:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22A083858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688245077; bh=EZK9UJ+XQKxUijD10HNNojA+pqFhKQnuzB7PeFLu3yE=; h=From:To:Subject:Date:From; b=VOKdJYFHwdrCQgqaq1fFBXgzfEbR8uPlOVFvMIY2hvkj6gnrx8Y8b16xFE02V5TWv +zb+RGu7bCGE+7HRIeIKdaxsx+2tpJFLFgH8eyv0iGTnKCBClVxP4yhLfavNhvyPl8 0weXCaHhzqJMWb+DWK/tAa3SwVLIs6Cfe6dYZpj0= From: "mirai at makinata dot eu" To: glibc-bugs@sourceware.org Subject: [Bug network/30604] New: Inconsistent getaddrinfo zone-index handling Date: Sat, 01 Jul 2023 20:57:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: network X-Bugzilla-Version: 2.37 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mirai at makinata dot eu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30604 Bug ID: 30604 Summary: Inconsistent getaddrinfo zone-index handling Product: glibc Version: 2.37 Status: UNCONFIRMED Severity: normal Priority: P2 Component: network Assignee: unassigned at sourceware dot org Reporter: mirai at makinata dot eu Target Milestone: --- Created attachment 14951 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D14951&action=3Ded= it Reproducer code While writing a procedure that validates IP addresses by using getaddrinfo I noticed the following inconsistencies when it comes to addresses with a zone index: An existing interface =E2=80=A6 =E2=80=A6 as a numeric value: 2001:db8::1%2: getaddrinfo: OK fe80::1%2: getaddrinfo: OK =E2=80=A6 as an interface name: 2001:db8::1%enp4s0: getaddrinfo: Name or service not known fe80::1%enp4s0: getaddrinfo: OK An absent interface=E2=80=A6 =E2=80=A6 as a numeric value: 2001:db8::1%9999: getaddrinfo: OK fe80::1%9999: getaddrinfo: OK =E2=80=A6 as an interface name: 2001:db8::1%foobar: getaddrinfo: Name or service not known fe80::1%foobar: getaddrinfo: Name or service not known I've included a small reproducer example below. (regarding the absent interface cases, I've no opinion on what behavior to expect here.) It strikes me as odd that the "2001:db8::1%enp4s0" case is treated differen= tly on the basis of its prefix (compared to "fe80:=E2=80=A6"). Although at the moment only link-local and multicast scopes have defined meaning [RFC4007], within the Introduction of the same RFC it states: =E2=80=A6 the IPv6 working group decided to =E2=80=A6 and is now investig= ating other forms of local IPv6 addressing. If I understood correctly this means that zone indexes should not be preferentially handled on basis of prefix since other scopes might be introduced later. In any case, I think that getaddrinfo should handle "2001:db8::1%enp4s0" in the same way it handles "2001:db8::1%2". Allowing %2 but not %enp4s0 is just massive hair-splitting. (especially when %2 happens to match %enp4s= 0) --=20 You are receiving this mail because: You are on the CC list for the bug.=