From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by sourceware.org (Postfix) with ESMTPS id CC6C8383B804 for ; Mon, 26 Jul 2021 23:05:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC6C8383B804 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru Received: from forward100q.mail.yandex.net (forward100q.mail.yandex.net [IPv6:2a02:6b8:c0e:4b:0:640:4012:bb97]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 92E7A4AC0CC9; Tue, 27 Jul 2021 02:05:02 +0300 (MSK) Received: from vla1-25221a47e1d2.qloud-c.yandex.net (vla1-25221a47e1d2.qloud-c.yandex.net [IPv6:2a02:6b8:c0d:3c06:0:640:2522:1a47]) by forward100q.mail.yandex.net (Yandex) with ESMTP id 8EB1A7080002; Tue, 27 Jul 2021 02:05:02 +0300 (MSK) Received: from vla5-047c0c0d12a6.qloud-c.yandex.net (vla5-047c0c0d12a6.qloud-c.yandex.net [2a02:6b8:c18:3484:0:640:47c:c0d]) by vla1-25221a47e1d2.qloud-c.yandex.net (mxback/Yandex) with ESMTP id Da31H0QWYY-52HStSPE; Tue, 27 Jul 2021 02:05:02 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1627340702; bh=52IktJKtpRL/qWkL/S+5b+Qm+z8EcKS84MqZxih4WcA=; h=In-Reply-To:Subject:To:Message-ID:From:References:Date:Reply-To; b=fec9YdJK1tJB0THp1yiD14gdlmvD/aJwC4ybSmwvSRSBryEgVImG8pvH81pnsRqYx gVa2w8jwsQZbr1I2cLjLFIJAncFlQqqePDpziz7GtP3GL5EN8DSCkjqK7DORkh9UcA yd4grPEHS1dMpxvQStLEGGN8uikYQ5ybUVaWpVMc= Authentication-Results: vla1-25221a47e1d2.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Received: by vla5-047c0c0d12a6.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id RJnVrbvwN5-512efeGx; Tue, 27 Jul 2021 02:05:01 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Mon, 26 Jul 2021 23:04:08 -0000 Date: Tue, 27 Jul 2021 02:04:08 +0300 From: Andrey Repin X-Mailer: The Bat! (v6.8.8) Home Reply-To: cygwin@cygwin.com X-Priority: 3 (Normal) Message-ID: <529122968.20210727020408@yandex.ru> To: Ken Brown , cygwin@cygwin.com Subject: Re: Problems with getifaddrs In-Reply-To: <05d378e2-dd26-9ca1-2888-22015c4c63bd@cornell.edu> References: <05d378e2-dd26-9ca1-2888-22015c4c63bd@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jul 2021 23:05:08 -0000 Greetings, Ken Brown! > While investigating emacs test failures, I found two problems with the > interfaces returned by getifaddrs(3): > 1. For an IPv6 interface, the netmask address family is always 0 instead of > AF_INET6. > 2. For a disconnected interface, the IPv4 address and netmask are sometimes 0. For a disconnected interface this could be true as Configuration for interface "TAP12" DHCP enabled: Yes IP Address: 172.16.40.6 Subnet Prefix: 172.16.40.0/24 (mask 255.255.255.0) InterfaceMetric: 25 Configuration for interface "TAP55" DHCP enabled: Yes InterfaceMetric: 25 Configuration for interface "TAP63" DHCP enabled: No IP Address: 172.18.104.18 Subnet Prefix: 172.18.104.0/22 (mask 255.255.252.0) InterfaceMetric: 25 There's actually no IP address assigned to TAP55, which could be reported as 0/0. Can you please cross-check with netsh interface ipv4 show addr > I will be sending patches to fix these problems later today, but I wanted to > report them here for reference. > I don't know enough about this to be sure that problem 2 is really a Cygwin bug. > Are there cases where a 0 IP address is appropriate? Or should it be up to > the caller of getifaddrs to handle that case? -- With best regards, Andrey Repin Tuesday, July 27, 2021 1:57:57 Sorry for my terrible english...