mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 14:10:28 +00:00
cleanup
This commit is contained in:
parent
e7726cfb00
commit
478b80a07a
@ -2,7 +2,7 @@ package yggdrasil
|
|||||||
|
|
||||||
import "os/exec"
|
import "os/exec"
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
//import "syscall"
|
|
||||||
import "golang.org/x/sys/unix"
|
import "golang.org/x/sys/unix"
|
||||||
|
|
||||||
import water "github.com/yggdrasil-network/water"
|
import water "github.com/yggdrasil-network/water"
|
||||||
@ -44,7 +44,6 @@ func (tun *tunDevice) setup(ifname string, iftapmode bool, addr string, mtu int)
|
|||||||
case iftapmode || ifname[:8] == "/dev/tap":
|
case iftapmode || ifname[:8] == "/dev/tap":
|
||||||
config = water.Config{DeviceType: water.TAP}
|
config = water.Config{DeviceType: water.TAP}
|
||||||
case !iftapmode || ifname[:8] == "/dev/tun":
|
case !iftapmode || ifname[:8] == "/dev/tun":
|
||||||
//config = water.Config{DeviceType: water.TUN}
|
|
||||||
panic("TUN mode is not currently supported on this platform, please use TAP instead")
|
panic("TUN mode is not currently supported on this platform, please use TAP instead")
|
||||||
default:
|
default:
|
||||||
panic("TUN/TAP name must be in format /dev/tunX or /dev/tapX")
|
panic("TUN/TAP name must be in format /dev/tunX or /dev/tapX")
|
||||||
|
@ -41,4 +41,3 @@ const TUNSIFINFO = (0x80000000) | ((8 & 0x1fff) << 16) | uint32(byte('t'))<<8 |
|
|||||||
const TUNGIFINFO = (0x40000000) | ((8 & 0x1fff) << 16) | uint32(byte('t'))<<8 | 92
|
const TUNGIFINFO = (0x40000000) | ((8 & 0x1fff) << 16) | uint32(byte('t'))<<8 | 92
|
||||||
const TUNSIFHEAD = (0x80000000) | ((4 & 0x1fff) << 16) | uint32(byte('t'))<<8 | 96
|
const TUNSIFHEAD = (0x80000000) | ((4 & 0x1fff) << 16) | uint32(byte('t'))<<8 | 96
|
||||||
const SIOCAIFADDR_IN6 = (0x80000000) | ((4 & 0x1fff) << 16) | uint32(byte('i'))<<8 | 27
|
const SIOCAIFADDR_IN6 = (0x80000000) | ((4 & 0x1fff) << 16) | uint32(byte('i'))<<8 | 27
|
||||||
|
|
||||||
|
@ -54,4 +54,3 @@ func (ti *tuninfo) setInfo(tun *tunDevice) {
|
|||||||
const TUNSIFINFO = (0x80000000) | ((12 & 0x1fff) << 16) | uint32(byte('t'))<<8 | 91
|
const TUNSIFINFO = (0x80000000) | ((12 & 0x1fff) << 16) | uint32(byte('t'))<<8 | 91
|
||||||
const TUNGIFINFO = (0x40000000) | ((12 & 0x1fff) << 16) | uint32(byte('t'))<<8 | 92
|
const TUNGIFINFO = (0x40000000) | ((12 & 0x1fff) << 16) | uint32(byte('t'))<<8 | 92
|
||||||
const SIOCAIFADDR_IN6 = (0x80000000) | ((4 & 0x1fff) << 16) | uint32(byte('i'))<<8 | 27
|
const SIOCAIFADDR_IN6 = (0x80000000) | ((4 & 0x1fff) << 16) | uint32(byte('i'))<<8 | 27
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user