1
0
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:
源文雨
2024-08-03 16:42:16 +08:00
parent bafeb149be
commit cf2daf9a3e
10 changed files with 46 additions and 38 deletions

View File

@@ -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 {