feat(wireguard): WIREGUARD_GSO option to disable TUN vnet hdr batching (#3424)

This commit is contained in:
Tyler MacDonald
2026-08-04 21:31:22 -04:00
committed by GitHub
parent 297d6480d0
commit 0186f2ff4a
20 changed files with 260 additions and 11 deletions
+30
View File
@@ -40,6 +40,7 @@ func Test_buildWireguardSettings(t *testing.T) {
PersistentKeepaliveInterval: ptrTo(time.Hour),
Interface: "wg1",
MTU: ptrTo(uint32(1000)),
GSO: ptrTo(true),
},
ipv6Supported: false,
settings: wireguard.Settings{
@@ -58,6 +59,35 @@ func Test_buildWireguardSettings(t *testing.T) {
RulePriority: 101,
IPv6: ptrTo(false),
MTU: 1000,
GSO: ptrTo(true),
},
},
"gso_disabled": {
connection: models.Connection{
IP: netip.AddrFrom4([4]byte{5, 6, 7, 8}),
Port: 58820,
PubKey: "public",
},
userSettings: settings.Wireguard{
PrivateKey: ptrTo("private"),
PreSharedKey: ptrTo(""),
PersistentKeepaliveInterval: ptrTo(time.Duration(0)),
Interface: "wg0",
MTU: ptrTo(uint32(0)),
GSO: ptrTo(false),
},
ipv6Supported: false,
settings: wireguard.Settings{
InterfaceName: "wg0",
PrivateKey: "private",
PublicKey: "public",
Endpoint: netip.AddrPortFrom(netip.AddrFrom4([4]byte{5, 6, 7, 8}), 58820),
Addresses: []netip.Prefix{},
AllowedIPs: []netip.Prefix{},
RulePriority: 101,
IPv6: ptrTo(false),
MTU: 1320,
GSO: ptrTo(false),
},
},
}