From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id 8BBE13858024 for ; Tue, 5 Jul 2022 23:58:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8BBE13858024 Received: by mail-oi1-x233.google.com with SMTP id u9so18131043oiv.12 for ; Tue, 05 Jul 2022 16:58:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=b6GesyX/FPmWptdlaShc7n0vOuRbHJ8zeMNhvsnjz5c=; b=j0jMf7+ymflJLdJu56DRpcUVs8ClD4NtwLdBtiDmlk0Ix/MT73VHmFdkEl8MIsRei/ 6kFm+hnWe2tF15Lam6aWbLI72M1WfuqIdB7nBWKhIupyS+sLetyb4pUpCelhcm83OoqW zOgT0zMwIc6UsRFjL0O1LDk/Wous6DbLjlNwO0LNK73r6PU6PuSZAFnpR3BuXKN8G6zi fLcZ65nm9YseXKyv4fbnhTdvTuaOeAo6f3NlljEI3y9uVTLkskov1tv8I0UKa6ek2Rjn bf0+dTUMBpuya2+x6UsisB+uXsKQlPgn0a1tYbeLh5i3mXwUO/nwvSOvGtyidOwOscP4 EhpA== X-Gm-Message-State: AJIora/3EMbEhM0ucEKbcSJbKWsfWLNy1sp8GmLOx0tV8fZiOn8VpIm0 DizKX7kpDZAm3osj4/WsMfHdU5ajyDj6iUB2 X-Google-Smtp-Source: AGRyM1sVE9PtIfPzApJTDWYVhSafc7BGDZNeCEtte4bawM7mOPs+lf8DnGlOOUuw07M2Qu7XyKg0rw== X-Received: by 2002:a54:4809:0:b0:335:502b:cedc with SMTP id j9-20020a544809000000b00335502bcedcmr21203712oij.189.1657065480904; Tue, 05 Jul 2022 16:58:00 -0700 (PDT) Received: from [172.31.250.1] ([47.184.51.90]) by smtp.gmail.com with ESMTPSA id t20-20020a056871021400b0010c1abbc18asm541265oad.46.2022.07.05.16.58.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Jul 2022 16:58:00 -0700 (PDT) Message-ID: <8698a1da-4656-0450-fac3-c7b7fc422903@gmail.com> Date: Tue, 5 Jul 2022 18:58:00 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: inet_net_pton() alternative for IPv6 Content-Language: en-US To: tomas@tuxteam.de Cc: libc-help@sourceware.org References: From: Ian Pilcher In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2022 23:58:02 -0000 On 7/4/22 13:23, tomas@tuxteam.de wrote: > I never tried it, but this is what my version [1] of the libc docs say: > > -- Function: int inet_pton (int AF, const char *CP, void *BUF) > > Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX > Safety Concepts::. > > This function converts an Internet address (either IPv4 or IPv6) > from presentation (textual) to network (binary) format. AF should > be either ‘AF_INET’ or ‘AF_INET6’, as appropriate for the type of > address being converted. CP is a pointer to the input string, and > BUF is a pointer to a buffer for the result. It is the caller’s > responsibility to make sure the buffer is large enough. You're looking at the wrong function. inet_pton() does support IPv6; inet_net_pton() does not (even though its interface is designed in a way that it could accomodate it). -- ======================================================================== Google Where SkyNet meets Idiocracy ========================================================================