1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-27 06:10:26 +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

@@ -5,7 +5,7 @@ package lower
import "net"
func (n *NIC) Up() {
func (n *NICIO) Up() {
execute("ifconfig", n.ifce.Name(), "mtu", n.mtu) // max: 9159
execute(
"ifconfig", n.ifce.Name(),
@@ -19,7 +19,7 @@ func (n *NIC) Up() {
}
}
func (n *NIC) Down() {
func (n *NICIO) Down() {
execute("route", "delete", n.subnet.String(), "-interface", n.ifce.Name())
for _, c := range n.cidrs {
execute("route", "delete", c, "-interface", n.ifce.Name())