[v6ops] getaddrinfo glitch (Re: An Update to Happy Eyeballs)

神明達哉 <jinmei@wide.ad.jp> Thu, 23 March 2017 02:50 UTC

Return-Path: <jinmei.tatuya@gmail.com>
X-Original-To: v6ops@ietfa.amsl.com
Delivered-To: v6ops@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BD79B1294B5 for <v6ops@ietfa.amsl.com>; Wed, 22 Mar 2017 19:50:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.701
X-Spam-Level:
X-Spam-Status: No, score=-1.701 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.197, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GaWvqegY47Sj for <v6ops@ietfa.amsl.com>; Wed, 22 Mar 2017 19:50:54 -0700 (PDT)
Received: from mail-qt0-x236.google.com (mail-qt0-x236.google.com [IPv6:2607:f8b0:400d:c0d::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 086AB12940F for <v6ops@ietf.org>; Wed, 22 Mar 2017 19:50:54 -0700 (PDT)
Received: by mail-qt0-x236.google.com with SMTP id n21so165498691qta.1 for <v6ops@ietf.org>; Wed, 22 Mar 2017 19:50:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to:cc; bh=7j3xs9k8JJ9wb3cYDtb1EWlHDIvXWBui2oE6dntOLjs=; b=tcvEYdquSXgEVcJt9eFiQK8uDRJVv4gQ7j9BTRqCJVXRQdpLRRJa24iMSGoKQt7DLD /tBUVxEN64TNImthy4Ps5Sl9fmm6I7nlOF3Utafq9JrnbsoZRN8gMpzEj9se4zSLihQx tH+nyLqbEqutROvD+aMWRnruUV8K91vTAYZGUWUmIvbbqKs0mHBslIpiuBlhDs7F0vE/ Wbh9WGbXlgH1hMbay0+t8xV1OLq3NHnU8g0B0ZOGSlgMJ19dcMLV05JBfywMTEIBEiYE ABuN+/hVCi+cFO9CD2DZkRZ+JGK7pC6mtbccxWrcEoQwYDZfkDrLIIvVND1hZfFx+Axp eBfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to:cc; bh=7j3xs9k8JJ9wb3cYDtb1EWlHDIvXWBui2oE6dntOLjs=; b=l5AIG6qPH63m+kNyfKtHEltADqocOxbkXtvT5kRWCKCCorNSV/ygCVPlKcODDvg29x zwPDdFjXj8qEbGcGppHPDujyTU0+KE+HqK5P2OR78M/Zhtv32cP+RLlC9kH0Uq3Oh3QC qYFt8BWF48x6MkpAVrBW9G0r19J0+4+LkQVVyg0gGtKr0Do7wGT+c9HFKsDdWmLiPxCV 5P7RyqkUotqBo4ZvYjWu2fv9fCcbaTd06jqOtsyiLoD3M5om7GMoe42ZPcdatBo/V7Aa FJt5CKL7amFzSWmIfwy+wsYTCSJ0MNI9NP0xCEESCCxX7GEvi79FYZRkpt1chtlaKcXx WESQ==
X-Gm-Message-State: AFeK/H179d+lOsxJMsbgKJMCkhjNR/P/W/n+74E3pg6QuRupqFdjt6qGVU5vYzyS/xMy4b8NNnyPG6YIty1DXg==
X-Received: by 10.237.42.194 with SMTP id t60mr184270qtd.269.1490237453072; Wed, 22 Mar 2017 19:50:53 -0700 (PDT)
MIME-Version: 1.0
Sender: jinmei.tatuya@gmail.com
Received: by 10.237.61.204 with HTTP; Wed, 22 Mar 2017 19:50:52 -0700 (PDT)
From: 神明達哉 <jinmei@wide.ad.jp>
Date: Wed, 22 Mar 2017 19:50:52 -0700
X-Google-Sender-Auth: EAoSnRyouYp42Co3q9jiS21u5kY
Message-ID: <CAJE_bqdQnYL8S044zqZ6MfOAYCBke-y-m-D6tE2Hj0vV5aYKNA@mail.gmail.com>
To: Brian E Carpenter <brian.e.carpenter@gmail.com>
Cc: Job Snijders <job@instituut.net>, IPv6 Operations <v6ops@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/v6ops/9VoUA9Yb58tdsYsYK0lUqeiEly0>
Subject: [v6ops] getaddrinfo glitch (Re: An Update to Happy Eyeballs)
X-BeenThere: v6ops@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: v6ops discussion list <v6ops.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/v6ops>, <mailto:v6ops-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/v6ops/>
List-Post: <mailto:v6ops@ietf.org>
List-Help: <mailto:v6ops-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/v6ops>, <mailto:v6ops-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Mar 2017 02:50:56 -0000

(I suspect it's now off topic for the HE thread).

At Thu, 23 Mar 2017 11:22:15 +1300,
Brian E Carpenter <brian.e.carpenter@gmail.com> wrote:

> > Perhaps of interest to this group:
> >
> > https://blog.powerdns.com/2014/05/21/a-surprising-discovery-on-converting-ipv6-addresses-we-no-longer-prefer-getaddrinfo/
>
> What a bizarre idea to use getaddrinfo() for format conversion, when
> inet_pton() and inet_ntop() exist.
>
> My sympathy is limited.

+1, but (as the blog itself notes) there's at least one thing that
(some implementations of) getaddrinf() can do but inet_pton() can't:
handle the extended scoped-address format as defined in RFC4007 and
set the corresponding zone index to sockaddr_in6.sin6_scope_id.

My sympathy is still limited since the blog post seems to suggest
another instance of commonly observed trap: overreaction on glitches
of one particular implementation (often that's Linux or glibc in my
biased experiences).  I suspect "talking to the kernel, and
enumerating all local IP addresses (!)" is to sort converted addresses
per RFC 6724.  Obviously it's not necessary if the purpose of the
getaddrinfo() call is to just convert textual numeric IPv6 address
into a binary form (like the case mentioned in the blog), and, as far
as I remember, BSDs implementation of getaddrinfo() doesn't do such
an obvious waste.

At the very least the blog should point to a specific poor
implementation, and, say that even if it's not an inherent defect of
getaddrinfo() itself but due to one bad implementation they should
give up using it to be portable.

--
JINMEI, Tatuya

p.s. I have no opinion about whether getaddrinfo() is a good choice
for HE.  This message is not to defend it in that context.