On Fri, Feb 24, 2017 at 4:11 PM, André Hentschel nerv@dawncrow.de wrote:
Am 23.02.2017 um 02:06 schrieb Bruno Jesus:
On Wed, Feb 22, 2017 at 5:01 PM, André Hentschel nerv@dawncrow.de wrote:
diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index e0701a3..2f818ff 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -2067,6 +2067,9 @@ static void test_GetUnicastIpAddressEntry(void) if (row.Address.si_family == AF_INET6) ok(row.ScopeId.Value == row.Address.Ipv6.sin6_scope_id, "Expected %d, got %d\n", row.Address.Ipv6.sin6_scope_id, row.ScopeId.Value);
else if (row.DadState == IpDadStateTentative)
ok(row.ScopeId.Value == aa->IfIndex, "Expected %d, got %d\n",
aa->IfIndex, row.ScopeId.Value); else ok(row.ScopeId.Value == 0, "Expected 0, got %d\n", row.ScopeId.Value); ok(row.CreationTimeStamp.QuadPart, "CreationTimeStamp is 0\n");
It may be bikeshedding but 2 things call my attention. The first is that ScopeID is a IPv6 only field, it is very weird that Windows is using it for something. The second is that it may be by chance that ScopeID matches the interface index, tentative means that the DAD mechanism is still working into checking the IP in the network, so ScopeID in such case would be meaningless until it turns into IpDadStatePreferred or maybe one of the other error states.
Hi,
You are right, it is weird, but what do you suggest? Rather adding a trace?
I did many tests in Windows 8 forcing different configurations in the IPv4 and IPv6 addresses for an adapter. When in tentative state I got 0 for scopeID in the IPv4 instead of ifIndex. Ipv6 seems to always match the value from the address.Ipv6.sin6_scope_id as expected.
I tried finding a way to group the results in order to make a more broad IF but I think it won't work so I really think it is better to drop the else and leave the scopeid test for ipv6 only.
Best wishes, Bruno