diff --git a/core/device/fd/fd.go b/core/device/fd/fd.go index 95e6257..0e5c66f 100644 --- a/core/device/fd/fd.go +++ b/core/device/fd/fd.go @@ -1,3 +1,5 @@ package fd const Driver = "fd" + +const defaultMTU = 1500 diff --git a/core/device/fd/fd_unix.go b/core/device/fd/fd_unix.go index 7bce2a9..231a219 100644 --- a/core/device/fd/fd_unix.go +++ b/core/device/fd/fd_unix.go @@ -23,6 +23,9 @@ func Open(name string, mtu uint32) (device.Device, error) { if err != nil { return nil, fmt.Errorf("cannot open fd: %s", name) } + if mtu == 0 { + mtu = defaultMTU + } return open(fd, mtu) }