Skip to content

Commit 0a7fb07

Browse files
authored
Set mtu to old Containerization default (apple#1110)
The old mtu default in containerization was 1280 to account for some alpine/musl images that have issues with 1500. This changed in the last couple tags to be modifiable, but the new default is the standard 1500. Ideally we eventually allow supplying the mtu to be used when you create a network (or possibly a container creation setting), but for now just default in here back to what CZ used to use.
1 parent 0bceb23 commit 0a7fb07

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

‎Sources/Helpers/RuntimeLinux/IsolatedInterfaceStrategy.swift‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ import Containerization
2525
struct IsolatedInterfaceStrategy: InterfaceStrategy {
2626
public func toInterface(attachment: Attachment, interfaceIndex: Int, additionalData: XPCMessage?) -> Interface {
2727
let ipv4Gateway = interfaceIndex == 0 ? attachment.ipv4Gateway : nil
28-
return NATInterface(ipv4Address: attachment.ipv4Address, ipv4Gateway: ipv4Gateway, macAddress: attachment.macAddress)
28+
return NATInterface(
29+
ipv4Address: attachment.ipv4Address,
30+
ipv4Gateway: ipv4Gateway,
31+
macAddress: attachment.macAddress,
32+
// https://github.com/apple/containerization/pull/38
33+
mtu: 1280
34+
)
2935
}
3036
}

‎Sources/Helpers/RuntimeLinux/NonisolatedInterfaceStrategy.swift‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ struct NonisolatedInterfaceStrategy: InterfaceStrategy {
4444

4545
log.info("creating NATNetworkInterface with network reference")
4646
let ipv4Gateway = interfaceIndex == 0 ? attachment.ipv4Gateway : nil
47-
return NATNetworkInterface(ipv4Address: attachment.ipv4Address, ipv4Gateway: ipv4Gateway, reference: networkRef, macAddress: attachment.macAddress)
47+
return NATNetworkInterface(
48+
ipv4Address: attachment.ipv4Address,
49+
ipv4Gateway: ipv4Gateway,
50+
reference: networkRef,
51+
macAddress: attachment.macAddress,
52+
// https://github.com/apple/containerization/pull/38
53+
mtu: 1280
54+
)
4855
}
4956
}

0 commit comments

Comments
 (0)