mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-09 20:29:23 +02:00
feat(vpn): path MTU discovery to find the best MTU (#2586)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
//go:build integration
|
||||
|
||||
package pmtud
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/netip"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test_PathMTUDiscover(t *testing.T) {
|
||||
t.Parallel()
|
||||
const physicalLinkMTU = 1500
|
||||
const timeout = time.Second
|
||||
mtu, err := PathMTUDiscover(context.Background(), netip.MustParseAddr("1.1.1.1"),
|
||||
physicalLinkMTU, timeout, nil)
|
||||
require.NoError(t, err)
|
||||
t.Log("MTU found:", mtu)
|
||||
}
|
||||
Reference in New Issue
Block a user