Closed mikeharder closed 4 years ago
Repro Steps
NetworkInterface.GetAllNetworkInterfaces() .SelectMany(i => i.GetIPProperties().UnicastAddresses) .Select(a => a.Address) .Where(a => a.IsIPv6LinkLocal) .ToList() .ForEach(ip => Console.WriteLine($"IP: {ip}, ScopeId: {ip.ScopeId}"));
Windows .NET Core
IP: fe80::1234:5678:90ab:cdef%18, ScopeId: 18 IP: fe80::1234:5.6.7.8%15, ScopeId: 15
ipconfig /all
Link-local IPv6 Address . . . . . : fe80::1234:5678:90ab:cdef%18(Preferred)
OS X .NET Core
IP: fe80::1, ScopeId: 0 IP: fe80::1234:5678:90ab:cdef, ScopeId: 0
ifconfig
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 inet6 fe80::1234:5678:90ab:cdef%en0 prefixlen 64 scopeid 0x4
Linux .NET Core
IP: fe80::1234:5468:90ab:cdef, ScopeId: 0
eth0 inet6 addr: fe80::1234:5678:90ab:cdef/64 Scope:Link
cc: @ericeil @stephentoub
I believe we just need to store the scopeID on line 82 of UnixNetworkInterface.cs. We already have the scope ID there.
Repro Steps
Windows .NET Core
ipconfig /all
OS X .NET Core
ifconfig
Linux .NET Core
ifconfig