{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/26664","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/26664/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/26664/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/26664/events","html_url":"https://github.com/dotnet/corefx/issues/26664","id":292609865,"number":26664,"title":"Socket should default to InterNetworkV6 only if OSSupportsIPv6","user":{"login":"darobs","id":15346492,"avatar_url":"https://avatars2.githubusercontent.com/u/15346492?v=4","gravatar_id":"","url":"https://api.github.com/users/darobs","html_url":"https://github.com/darobs","followers_url":"https://api.github.com/users/darobs/followers","following_url":"https://api.github.com/users/darobs/following{/other_user}","gists_url":"https://api.github.com/users/darobs/gists{/gist_id}","starred_url":"https://api.github.com/users/darobs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darobs/subscriptions","organizations_url":"https://api.github.com/users/darobs/orgs","repos_url":"https://api.github.com/users/darobs/repos","events_url":"https://api.github.com/users/darobs/events{/privacy}","received_events_url":"https://api.github.com/users/darobs/received_events","type":"User","site_admin":false},"labels":[{"id":497898539,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Net.Sockets","name":"area-System.Net.Sockets","color":"d4c5f9","default":false},{"id":145399957,"url":"https://api.github.com/repos/dotnet/corefx/labels/enhancement","name":"enhancement","color":"207de5","default":true},{"id":145399958,"url":"https://api.github.com/repos/dotnet/corefx/labels/up-for-grabs","name":"up-for-grabs","color":"159818","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/5","html_url":"https://github.com/dotnet/corefx/milestone/5","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/5/labels","id":1328080,"number":5,"title":"Future","description":"Milestone tracking issues not triaged to a planned release. Work in this milestone may happen, or may not: it is not committed.","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars1.githubusercontent.com/u/1302850?v=4","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":1695,"closed_issues":141,"state":"open","created_at":"2015-09-29T00:25:45Z","updated_at":"2018-02-22T23:46:52Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2018-01-30T00:21:40Z","updated_at":"2018-02-23T17:22:23Z","closed_at":null,"author_association":"NONE","body":"https://github.com/dotnet/corefx/blob/ff478ef06a053f145a784a9640a6f85d8fe560a9/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs#L81\r\n\r\nI am working through a customer issue for the IoT Edge, running it on an embedded ARM device without IPv6.  \r\n\r\nhttps://github.com/Azure/iot-edge/issues/481 \r\n\r\nThe IoT Edge project uses libraries which wind up calling the `Socket(SocketType socketType, ProtocolType protocolType)` constructor linked at the top.  This Socket constructor will by default choose `AddressFamily.InterNetworkV6` and set `DualMode = true;` even if the OS does not support IPv6. Creation of a Socket with a IPv6 address family on my test system throws an Error -97 EAFNOSUPPORT.\r\n\r\nShould the Socket constructor check to see if IPv6 is supported before setting the defaults?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/368077571","html_url":"https://github.com/dotnet/corefx/issues/26664#issuecomment-368077571","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/26664","id":368077571,"user":{"login":"darobs","id":15346492,"avatar_url":"https://avatars2.githubusercontent.com/u/15346492?v=4","gravatar_id":"","url":"https://api.github.com/users/darobs","html_url":"https://github.com/darobs","followers_url":"https://api.github.com/users/darobs/followers","following_url":"https://api.github.com/users/darobs/following{/other_user}","gists_url":"https://api.github.com/users/darobs/gists{/gist_id}","starred_url":"https://api.github.com/users/darobs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darobs/subscriptions","organizations_url":"https://api.github.com/users/darobs/orgs","repos_url":"https://api.github.com/users/darobs/repos","events_url":"https://api.github.com/users/darobs/events{/privacy}","received_events_url":"https://api.github.com/users/darobs/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T17:22:23Z","updated_at":"2018-02-23T17:22:23Z","author_association":"NONE","body":"I think this is a pretty straightforward reproduction:\r\n```\r\nusing System;\r\nusing System.Net.Sockets;\r\n\r\nnamespace ConsoleApp4\r\n{\r\n    class Program\r\n    {\r\n        static void Main(string[] args)\r\n        {\r\n            Console.WriteLine($\"IPV4/IPV6Supported: {Socket.OSSupportsIPv4}/{Socket.OSSupportsIPv6}\");\r\n            using (var s = new Socket(SocketType.Stream, ProtocolType.Tcp))\r\n            {\r\n                Console.WriteLine(\"Created a socket with default IPV6 address family and dual mode.\");\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\nOutput from system with IPv6 disabled:\r\n```\r\n$ modprobe -c | fgrep \"ipv6 disable\"\r\noptions ipv6 disable=1\r\n$ sudo docker run sockettest\r\nIPV4/IPV6Supported: True/False\r\n\r\nUnhandled Exception: System.Net.Sockets.SocketException: Address family not supported by protocol\r\n   at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)\r\n   at ConsoleApp4.Program.Main(String[] args) in C:\\Users\\darobs\\Source\\Repos\\ConsoleApp4\\ConsoleApp4\\Program.cs:line 11\r\n```\r\nOutput from system w/IPv6 enabled:\r\n```\r\n$ modprobe -c | fgrep \"ipv6 disable\"\r\n$ sudo docker run sockettest\r\nIPV4/IPV6Supported: True/True\r\nCreated a socket with default IPV6 address family and dual mode.\r\n```\r\n"}}
{"actor":{"display_login":"darobs"}}