get the fd instead of depending on water to do it

This commit is contained in:
Arceliar 2018-03-04 13:57:34 -06:00
parent 3eccca62cc
commit cd0d1a1d26
2 changed files with 6 additions and 15 deletions

View file

@ -2,12 +2,13 @@
package yggdrasil
import "os"
import "os/exec"
import "unsafe"
import "golang.org/x/sys/unix"
import water "github.com/yggdrasil-network/water"
import "github.com/yggdrasil-network/water"
type in6_addrlifetime struct {
ia6t_expire float64
@ -61,7 +62,7 @@ func (tun *tunDevice) setup(ifname string, iftapmode bool, addr string, mtu int)
}
func (tun *tunDevice) setupAddress(addr string) error {
fd := tun.iface.FD().Fd()
fd := tun.iface.ReadWriteCloser.(*os.File).Fd()
var err error
var ti tuninfo