Re: Problems with getifaddrs
On 7/26/2021 7:04 PM, Andrey Repin wrote: There's actually no IP address assigned to TAP55, which could be reported as 0/0. Follow-up for the sake of the archives: The question I raised is whether getifaddrs *should* report an IP address of 0/0 in this case. After checking what happens on Linux, Corinna agreed that it should not do this, and we've now changed it: https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=b88d686a68d7bf2ff22d857a28d37fe4fdbafdf2 Ken -- 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
Re: Problems with getifaddrs
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
Problems with getifaddrs
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. 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? Ken -- 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