fix mono's DNS lookup by using MacOsNetworkInterfaceAPI like FreeBSD does, fixes GitHub issue #8168, ok robert@ (maintainer)
This commit is contained in:
parent
7f62e54a59
commit
e4d8c0cd87
@ -1,11 +1,11 @@
|
||||
# $OpenBSD: Makefile,v 1.123 2019/01/11 18:49:37 jca Exp $
|
||||
# $OpenBSD: Makefile,v 1.124 2019/03/25 13:05:39 thfr Exp $
|
||||
|
||||
USE_WXNEEDED= Yes
|
||||
|
||||
COMMENT= cross platform, open source .NET developement framework
|
||||
|
||||
V= 5.14.0.177
|
||||
REVISION= 0
|
||||
REVISION= 1
|
||||
|
||||
DISTNAME= mono-${V}
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
$OpenBSD: patch-mcs_class_System_System_Net_NetworkInformation_NetworkInterface_cs,v 1.1 2019/03/25 13:05:39 thfr Exp $
|
||||
|
||||
Initialize network interface for OpenBSD like for FreeBSD to address issue
|
||||
https://github.com/mono/mono/issues/8168
|
||||
Pull Request: https://github.com/mono/mono/pull/13633
|
||||
|
||||
Index: mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs
|
||||
--- mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs.orig
|
||||
+++ mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs
|
||||
@@ -526,7 +526,7 @@ namespace System.Net.NetworkInformation {
|
||||
bool runningOnUnix = (Environment.OSVersion.Platform == PlatformID.Unix);
|
||||
|
||||
if (runningOnUnix) {
|
||||
- if (Platform.IsMacOS || Platform.IsFreeBSD)
|
||||
+ if (Platform.IsMacOS || Platform.IsFreeBSD || Platform.IsOpenBSD)
|
||||
return new MacOsNetworkInterfaceAPI ();
|
||||
|
||||
return new LinuxNetworkInterfaceAPI ();
|
42
lang/mono/patches/patch-mcs_class_System_System_Platform_cs
Normal file
42
lang/mono/patches/patch-mcs_class_System_System_Platform_cs
Normal file
@ -0,0 +1,42 @@
|
||||
$OpenBSD: patch-mcs_class_System_System_Platform_cs,v 1.1 2019/03/25 13:05:39 thfr Exp $
|
||||
|
||||
add bool for Platform.IsOpenBSD, to address
|
||||
https://github.com/mono/mono/issues/8168
|
||||
Upstreamed in PR: https://github.com/mono/mono/pull/13633
|
||||
|
||||
Index: mcs/class/System/System/Platform.cs
|
||||
--- mcs/class/System/System/Platform.cs.orig
|
||||
+++ mcs/class/System/System/Platform.cs
|
||||
@@ -48,6 +48,7 @@ namespace System {
|
||||
|
||||
#else
|
||||
static bool isFreeBSD;
|
||||
+ static bool isOpenBSD;
|
||||
|
||||
[DllImport ("libc")]
|
||||
static extern int uname (IntPtr buf);
|
||||
@@ -68,6 +69,9 @@ namespace System {
|
||||
case "FreeBSD":
|
||||
isFreeBSD = true;
|
||||
break;
|
||||
+ case "OpenBSD":
|
||||
+ isOpenBSD = true;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
Marshal.FreeHGlobal (buf);
|
||||
@@ -88,6 +92,14 @@ namespace System {
|
||||
if (!checkedOS)
|
||||
CheckOS();
|
||||
return isFreeBSD;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static bool IsOpenBSD {
|
||||
+ get {
|
||||
+ if (!checkedOS)
|
||||
+ CheckOS();
|
||||
+ return isOpenBSD;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user