delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/07/26/19:05:49

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
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
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
Date: Tue, 27 Jul 2021 02:04:08 +0300
From: Andrey Repin <anrdaemon AT yandex DOT ru>
X-Mailer: The Bat! (v6.8.8) Home
X-Priority: 3 (Normal)
Message-ID: <529122968.20210727020408@yandex.ru>
To: Ken Brown <kbrown AT cornell DOT edu>, cygwin AT cygwin DOT com
Subject: Re: Problems with getifaddrs
In-Reply-To: <05d378e2-dd26-9ca1-2888-22015c4c63bd@cornell.edu>
References: <05d378e2-dd26-9ca1-2888-22015c4c63bd AT cornell DOT edu>
MIME-Version: 1.0
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 AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

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...


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019