From 425034dee1b34609c6efa6c6239f9d8139ae5501 Mon Sep 17 00:00:00 2001 From: Gerrit91 Date: Mon, 2 Oct 2023 11:34:20 +0200 Subject: [PATCH] Avoid jumbo frames as it produces issues with traffic flow. --- pkg/netconf/interfaces_test.go | 5 +++-- pkg/netconf/systemd.go | 4 ++-- pkg/netconf/testdata/networkd/firewall/10-lan0.link | 2 +- pkg/netconf/testdata/networkd/firewall/11-lan1.link | 2 +- pkg/netconf/testdata/networkd/machine/10-lan0.link | 2 +- pkg/netconf/testdata/networkd/machine/11-lan1.link | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/netconf/interfaces_test.go b/pkg/netconf/interfaces_test.go index b0d6092..9e9447d 100644 --- a/pkg/netconf/interfaces_test.go +++ b/pkg/netconf/interfaces_test.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "sort" + "strings" "testing" "github.com/google/go-cmp/cmp" @@ -70,8 +71,8 @@ func equalDirs(dir1, dir2 string) (bool, string) { if err != nil { panic(err) } - s1 := string(f1) - s2 := string(f2) + s1 := strings.TrimSpace(string(f1)) + s2 := strings.TrimSpace(string(f2)) if !cmp.Equal(s1, s2) { return false, fmt.Sprintf("file %s differs: %v", f, cmp.Diff(s1, s2)) } diff --git a/pkg/netconf/systemd.go b/pkg/netconf/systemd.go index 6d5ecb1..725a861 100644 --- a/pkg/netconf/systemd.go +++ b/pkg/netconf/systemd.go @@ -15,9 +15,9 @@ const ( // tplSystemdNetworkLan defines the name of the template to render system.network file. tplSystemdNetworkLan = "networkd/10-lan.network.tpl" // mtuFirewall defines the value for MTU specific to the needs of a firewall. VXLAN requires higher MTU. - mtuFirewall = 9216 + mtuFirewall = 1500 // mtuMachine defines the value for MTU specific to the needs of a machine. - mtuMachine = 9000 + mtuMachine = 1440 ) type ( diff --git a/pkg/netconf/testdata/networkd/firewall/10-lan0.link b/pkg/netconf/testdata/networkd/firewall/10-lan0.link index 6b00713..9e5d783 100644 --- a/pkg/netconf/testdata/networkd/firewall/10-lan0.link +++ b/pkg/netconf/testdata/networkd/firewall/10-lan0.link @@ -6,4 +6,4 @@ PermanentMACAddress=00:03:00:11:11:01 [Link] Name=lan0 NamePolicy= -MTUBytes=9216 \ No newline at end of file +MTUBytes=1500 diff --git a/pkg/netconf/testdata/networkd/firewall/11-lan1.link b/pkg/netconf/testdata/networkd/firewall/11-lan1.link index 348f26f..ebd4f9a 100644 --- a/pkg/netconf/testdata/networkd/firewall/11-lan1.link +++ b/pkg/netconf/testdata/networkd/firewall/11-lan1.link @@ -6,4 +6,4 @@ PermanentMACAddress=00:03:00:11:12:01 [Link] Name=lan1 NamePolicy= -MTUBytes=9216 \ No newline at end of file +MTUBytes=1500 diff --git a/pkg/netconf/testdata/networkd/machine/10-lan0.link b/pkg/netconf/testdata/networkd/machine/10-lan0.link index 498c09d..f3c9efa 100644 --- a/pkg/netconf/testdata/networkd/machine/10-lan0.link +++ b/pkg/netconf/testdata/networkd/machine/10-lan0.link @@ -6,4 +6,4 @@ PermanentMACAddress=00:03:00:11:11:01 [Link] Name=lan0 NamePolicy= -MTUBytes=9000 \ No newline at end of file +MTUBytes=1440 diff --git a/pkg/netconf/testdata/networkd/machine/11-lan1.link b/pkg/netconf/testdata/networkd/machine/11-lan1.link index 5d15b91..71745cf 100644 --- a/pkg/netconf/testdata/networkd/machine/11-lan1.link +++ b/pkg/netconf/testdata/networkd/machine/11-lan1.link @@ -6,4 +6,4 @@ PermanentMACAddress=00:03:00:11:12:01 [Link] Name=lan1 NamePolicy= -MTUBytes=9000 \ No newline at end of file +MTUBytes=1440