mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-05 07:50:24 +08:00
fix: use nic mtu that minus packet header
This commit is contained in:
5
main.go
5
main.go
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/fumiama/WireGold/config"
|
||||
"github.com/fumiama/WireGold/gold/head"
|
||||
"github.com/fumiama/WireGold/helper"
|
||||
"github.com/fumiama/WireGold/upper"
|
||||
"github.com/fumiama/WireGold/upper/services/wg"
|
||||
@@ -144,8 +145,8 @@ func main() {
|
||||
if c.EndPoint == "" {
|
||||
displayHelp("nil endpoint")
|
||||
}
|
||||
if c.MTU == 0 {
|
||||
displayHelp("nil mtu")
|
||||
if c.MTU <= head.PacketHeadLen {
|
||||
displayHelp("invalid mtu")
|
||||
}
|
||||
w, err := wg.NewWireGold(&c)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user