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
[System.Net] Replace use of obsolete SupportsIPv6
property.
#7584
Conversation
The codepath quoted on the issue which always sets the obsolete property to false isn't used on Mono so I don't understand why this happens. |
@akoeplinger we define mono/mcs/class/System/Makefile Line 62 in 4e33896
|
I think the fix should be to move the code we have to location which is compiled
to
|
@alexischr you missed this little nugget at the top of the file 😄 :
|
@akoeplinger Sorry, I saw that today 🤦♂️ That got me confused and had to verify that the change in |
oh:
|
Yeah but that should just return true if the config section isn't there: mono/mcs/class/System/ReferenceSources/SettingsSectionInternal.cs Lines 31 to 43 in 4e33896
... and looking at our machine.config file we're not setting it. |
mcs/class/System/System.Net/Dns.cs
Outdated
@@ -321,7 +321,7 @@ private static IPHostEntry hostent_to_IPHostEntry(string originalHostName, strin | |||
IPAddress newAddress = IPAddress.Parse(h_addrlist[i]); | |||
|
|||
#pragma warning disable 618 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pragma should no longer be necessary.
@akoeplinger "system.net/settings" section is declared here: mono/data/net_4_5/machine.config Line 87 in 29c2ba9
And the "ipv6/enabled" defaults to false:
|
b13fd68
to
ceedc06
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so you're right that the config setting defaults to false - but in the MS referencesource code nothing uses that config setting anymore except a few old APIs and everything else switched over to OSSupportsIPv6.
Two consistency comments to fix and we're good to go :)
@@ -318,7 +318,7 @@ private static IPHostEntry GetLocalHost() | |||
// old IPv4 gethostbyname(null). Instead we need | |||
// to do a more complete lookup. | |||
// | |||
if (Socket.SupportsIPv6) | |||
if (Socket.OSSupportsIPv6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert this change, we're not using this code.
mcs/class/System/System.Net/Dns.cs
Outdated
@@ -320,11 +320,9 @@ private static IPHostEntry hostent_to_IPHostEntry(string originalHostName, strin | |||
try { | |||
IPAddress newAddress = IPAddress.Parse(h_addrlist[i]); | |||
|
|||
#pragma warning disable 618 | |||
if( (Socket.SupportsIPv6 && newAddress.AddressFamily == AddressFamily.InterNetworkV6) || | |||
if( (Socket.OSSupportsIPv6 && newAddress.AddressFamily == AddressFamily.InterNetworkV6) || | |||
(Socket.SupportsIPv4 && newAddress.AddressFamily == AddressFamily.InterNetwork) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use Socket.OSSupportsIPv4
here so we're consistent.
The obsolete property was always set to false. Fixes mono#6940
@monojenkins backport 2017-12 |
@monojenkins backport 2018-02 |
@marek-safar backporting to 2017-12 failed, the patch results in conflicts:
Please backport manually! |
@marek-safar backporting to 2018-02 failed, the patch results in conflicts:
Please backport manually! |
@alexischr please backport manually |
[System.Net] Replace use of obsolete `SupportsIPv6` property.
[System.Net] Replace use of obsolete `SupportsIPv6` property.
[System.Net] Replace use of obsolete `SupportsIPv6` property. Commit migrated from mono/mono@2f21177
The obsolete property was always set to false. Fixes #6940