From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by sourceware.org (Postfix) with ESMTPS id 13ACF38582A2 for ; Mon, 4 Jul 2022 19:34:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 13ACF38582A2 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-fe023ab520so14328070fac.10 for ; Mon, 04 Jul 2022 12:34:34 -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:references:from:in-reply-to :content-transfer-encoding; bh=TPqI1Tvh9pDrpAiThYetlfrY+s6IAw0BkWN8xMrQFJE=; b=SM6mfWohdTMjy2V8qGeuubIn54uLW0kw6OOw9yHUH+IvI16e4Zqu2grPoBnEuylDHg o1eUyjirAfIS74HcZGu9ypFgPKsYKl2ivEBC0r7Pt6cAS9dX2a7BVPdaX5i+NPru88UQ 3FnONALc+wETTcanM4Y+wN92BYR6p0+sKgS3+1EXnIYJvqceV/RN23dyB7UpRweaYL6R UnYJ0p2t3Q9YN4B0okfvy8X9t3I5rYI4/koYNLfFPh1P2iPbEUoWKzPSj9JJR2VNG113 fiMt12Y+ZC2H6ykarKt/BBRwsn0NXiIF24K9G3o0mp1tDEhmeei6U1H/3cWEJzYQDOX7 2sww== X-Gm-Message-State: AJIora9qxHfXErCuGmWASRbU/K9lPMRDtFN9C9DlQDQELLB32BG2XK0z pvRhWJCz67tSCXOMwDfzK/U5bWp5scaA6fJl X-Google-Smtp-Source: AGRyM1u27dUxdmO1vywArXK5u5eAjsMRoSddL8sE8PyKTXv3t9AnEYYDJ9yb/h6ZtbnJEd8N5PTJWA== X-Received: by 2002:a05:6870:9a09:b0:e9:20a7:6cf6 with SMTP id fo9-20020a0568709a0900b000e920a76cf6mr19510242oab.122.1656963273435; Mon, 04 Jul 2022 12:34:33 -0700 (PDT) Received: from [172.31.250.1] ([47.184.51.90]) by smtp.gmail.com with ESMTPSA id a28-20020a0568301ddc00b00616b06d520dsm14865324otj.5.2022.07.04.12.34.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jul 2022 12:34:33 -0700 (PDT) Message-ID: <4e18e0fd-44dd-4236-8275-22dffdbf5892@gmail.com> Date: Mon, 4 Jul 2022 14:34:32 -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: Florian Weimer , Ian Pilcher via Libc-help References: <87let8681g.fsf@oldenburg.str.redhat.com> From: Ian Pilcher In-Reply-To: <87let8681g.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: Mon, 04 Jul 2022 19:34:35 -0000 On 7/4/22 13:34, Florian Weimer wrote: > There's inet_pton, or getaddrinfo AI_NUMERICHOST if you want to produce > a full socket address (with a port number as well). I just need to parse an IP address and prefix length or network address, in CIDR format. Unfortunately, inet_pton() won't parse the address portion of a CIDR address, so it looks like I'm going to have to make a zero-terminated copy of that part of the address, just so I can pass it to inet_pton(). -- ======================================================================== Google Where SkyNet meets Idiocracy ========================================================================