After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762455 - gssdp fails at auto-detect network device (does not detect any)
gssdp fails at auto-detect network device (does not detect any)
Status: RESOLVED FIXED
Product: gssdp
Classification: Other
Component: General
unspecified
Other Windows
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-22 13:54 UTC by Florian Zwoch
Modified: 2019-02-22 09:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
iterate over all addresses and prefixes (4.23 KB, patch)
2016-02-23 11:53 UTC, Florian Zwoch
committed Details | Review

Description Florian Zwoch 2016-02-22 13:54:22 UTC
gssdp_client_new() fails with the error message "No default route?".

I think this is related to some IPv4/IPv6 behavior. In get_host_ip() the call to GetAdaptersAddresses() seems to return devices with IPv6 addresses as primary address only(?).

At least further down this check:

if (address->Address.lpSockaddr->sa_family != AF_INET)
    continue;

always triggers as sa_family is set AF_INET6. (Tested on a Windows 7 instance)

I could quickly get it to work by changing GetAdaptersAddresses() to look for AF_INET instead of AF_UNSPEC. But I have a vague feeling that the correct fix would be something different..
Comment 1 Jens Georg 2016-02-22 19:48:43 UTC
This code used to work on win7, maybe by luck.

I think that it additionally has to iterate through all the unicast addresses, not just looking at the first only.
Comment 2 Jens Georg 2016-02-22 19:50:58 UTC
See https://msdn.microsoft.com/de-de/library/windows/desktop/aa366058%28v=vs.85%29.aspx, the "Next" member

I currently don't have a working windows build env, if you can cook a patch and test that would be great.
Comment 3 Florian Zwoch 2016-02-23 11:53:34 UTC
Created attachment 321943 [details] [review]
iterate over all addresses and prefixes

Here is my attempt from a semi working mingw installation from a virtual machine..

I iterate over all addresses and pick the first AF_INET one. Note that the same seems to be needed for the prefix as well. Again I just iterate over these prefixes and try to find the first AF_INET one.

I have no idea on how these addresses are supposed to map to each other though. Looks like I just cross my fingers and hope for the best the match up. Any better way?

At least the patch compiles and the resulting code was working on a native Windows 7 machine.
Comment 4 Jens Georg 2016-03-05 22:25:11 UTC
I think the two lists are considered to match and can be iterated in parallel, I have to check that.
Comment 5 Florian Zwoch 2016-03-06 12:58:45 UTC
Unfortunately, I think they can't. If I remember correctly they were different in my case.

For the interface I found my desired AF_INET one after skipping just the first AF_INET6.

For the prefix the first two at least (maybe even 3, unsure) were AF_INET6 ones before I found my AF_INET.
Comment 6 Quentin "Sardem FF7" Glidic 2016-05-23 13:07:58 UTC
I can confirm that this patch works in my Windows 10 MSYS2/MinGW64 environment.