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

@@ -17,7 +17,6 @@ import (
"github.com/fumiama/WireGold/config"
"github.com/fumiama/WireGold/gold/link"
"github.com/fumiama/WireGold/helper"
"github.com/fumiama/WireGold/lower"
)
const suffix32 = "㴄"
@@ -104,12 +103,16 @@ func (wg *WG) init(srcport, dstport uint16) {
MyEndpoint: wg.c.EndPoint,
Network: wg.c.Network,
PrivateKey: &wg.key,
NIC: lower.NewNIC(myip, mysubnet, strconv.FormatInt(wg.c.MTU, 10), cidrs...),
SrcPort: srcport,
DstPort: dstport,
MTU: uint16(wg.c.MTU),
SpeedLoop: wg.c.SpeedLoop,
Mask: wg.c.Mask,
NICConfig: &link.NICConfig{
IP: myip,
SubNet: mysubnet,
CIDRs: cidrs,
},
SrcPort: srcport,
DstPort: dstport,
MTU: uint16(wg.c.MTU),
SpeedLoop: wg.c.SpeedLoop,
Mask: wg.c.Mask,
})
for _, peer := range wg.c.Peers {