Browse Source

config: gate bridged networking behind macOS 11.3

Requires inherited sandbox fix to work.
pull/2742/head
osy 4 years ago
parent
commit
13664282a2
  1. 6
      Configuration/UTMConfiguration+Defaults.m
  2. 8
      Platform/Shared/VMConfigNetworkView.swift

6
Configuration/UTMConfiguration+Defaults.m

@ -48,7 +48,11 @@
self.consoleFontSize = @12;
self.consoleTheme = @"Default";
#if TARGET_OS_OSX
self.networkMode = @"shared";
if (@available(macOS 11.3, *)) {
self.networkMode = @"shared";
} else {
self.networkMode = @"emulated";
}
#else
self.networkMode = @"emulated";
#endif

8
Platform/Shared/VMConfigNetworkView.swift

@ -26,7 +26,13 @@ struct VMConfigNetworkView: View {
Form {
Section(header: Text("Hardware"), footer: EmptyView().padding(.bottom)) {
#if os(macOS)
NetworkModeSection(config: config)
if #available(macOS 11.3, *) { // requires macOS 11.3 inherited sandbox fix
NetworkModeSection(config: config)
} else {
Toggle(isOn: $config.networkEnabled.animation(), label: {
Text("Enabled")
})
}
#else
Toggle(isOn: $config.networkEnabled.animation(), label: {
Text("Enabled")

Loading…
Cancel
Save