feat: Allow large MTU sizes

This commit is contained in:
Kroese 2025-10-04 10:34:48 +02:00 committed by GitHub
parent 3b1c991de5
commit c90166dc22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -63,7 +63,7 @@ configureDHCP() {
if [[ "$MTU" != "0" && "$MTU" != "1500" ]]; then
if ! ip link set dev "$VM_NET_TAP" mtu "$MTU"; then
warn "Failed to set MTU size.."
warn "Failed to set MTU size to $MTU." && MTU="0"
fi
fi
@ -266,7 +266,7 @@ configureNAT() {
if [[ "$MTU" != "0" && "$MTU" != "1500" ]]; then
if ! ip link set dev "$VM_NET_TAP" mtu "$MTU"; then
warn "Failed to set MTU size.."
warn "Failed to set MTU size to $MTU." && MTU="0"
fi
fi
@ -443,10 +443,6 @@ getInfo() {
MTU=$(cat "/sys/class/net/$VM_NET_DEV/mtu")
fi
if [ "$MTU" -gt "1500" ]; then
info "MTU size is too large: $MTU, ignoring..." && MTU="0"
fi
if [[ "${ADAPTER,,}" != "virtio-net-pci" ]]; then
if [[ "$MTU" != "0" && "$MTU" != "1500" ]]; then
warn "MTU size is $MTU, but cannot be set for $ADAPTER adapters!" && MTU="0"