mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Update water go.mod references, fix some bugs in TAP mode (which should hopefully fix Windows support too)
This commit is contained in:
parent
36201895e7
commit
48ad3c5d7f
5 changed files with 33 additions and 18 deletions
|
@ -71,6 +71,9 @@ func (tun *TunAdapter) setup(ifname string, iftapmode bool, addr string, mtu int
|
|||
|
||||
// Sets the MTU of the TAP adapter.
|
||||
func (tun *TunAdapter) setupMTU(mtu int) error {
|
||||
if tun.iface == nil || tun.iface.Name() == "" {
|
||||
return errors.New("Can't configure MTU as TAP adapter is not present")
|
||||
}
|
||||
// Set MTU
|
||||
cmd := exec.Command("netsh", "interface", "ipv6", "set", "subinterface",
|
||||
fmt.Sprintf("interface=%s", tun.iface.Name()),
|
||||
|
@ -88,6 +91,9 @@ func (tun *TunAdapter) setupMTU(mtu int) error {
|
|||
|
||||
// Sets the IPv6 address of the TAP adapter.
|
||||
func (tun *TunAdapter) setupAddress(addr string) error {
|
||||
if tun.iface == nil || tun.iface.Name() == "" {
|
||||
return errors.New("Can't configure IPv6 address as TAP adapter is not present")
|
||||
}
|
||||
// Set address
|
||||
cmd := exec.Command("netsh", "interface", "ipv6", "add", "address",
|
||||
fmt.Sprintf("interface=%s", tun.iface.Name()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue