public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: Ken Brown <kbrown@cornell.edu>, cygwin@cygwin.com
Subject: Re: Problems with getifaddrs
Date: Tue, 27 Jul 2021 02:04:08 +0300	[thread overview]
Message-ID: <529122968.20210727020408@yandex.ru> (raw)
In-Reply-To: <05d378e2-dd26-9ca1-2888-22015c4c63bd@cornell.edu>

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


  reply	other threads:[~2021-07-26 23:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 15:15 Ken Brown
2021-07-26 23:04 ` Andrey Repin [this message]
2021-07-29 14:43   ` Ken Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=529122968.20210727020408@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=cygwin@cygwin.com \
    --cc=kbrown@cornell.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).