mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-06 17:26:58 +08:00
Improve: add default mtu for fd device
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
package fd
|
||||
|
||||
const Driver = "fd"
|
||||
|
||||
const defaultMTU = 1500
|
||||
|
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user