Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPAddresses returned from System.Net.NetworkInformation are missing ScopeID on OSX and Linux #17259

Closed
mikeharder opened this issue May 11, 2016 · 2 comments
Assignees
Labels
area-System.Net os-linux Linux OS (any supported distro)
Milestone

Comments

@mikeharder
Copy link

Repro Steps

  1. Run the following code, and compare the results to ipconfig/ifconfig:
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

ifconfig

eth0
inet6 addr: fe80::1234:5678:90ab:cdef/64 Scope:Link
@davidsh
Copy link
Contributor

davidsh commented May 11, 2016

cc: @ericeil @stephentoub

@stephentoub stephentoub self-assigned this May 11, 2016
@mellinoe
Copy link
Contributor

I believe we just need to store the scopeID on line 82 of UnixNetworkInterface.cs. We already have the scope ID there.

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 1.0.0-rtm milestone Jan 31, 2020
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net os-linux Linux OS (any supported distro)
Projects
None yet
Development

No branches or pull requests

5 participants