mirror of
https://github.com/yggdrasil-network/water.git
synced 2025-05-19 16:35:10 +03:00
use blocking mode pre-go1.11
This commit is contained in:
parent
240a3d7b51
commit
3fe638a7bf
13 changed files with 132 additions and 95 deletions
6
if.go
6
if.go
|
@ -57,10 +57,8 @@ func New(config Config) (ifce *Interface, err error) {
|
|||
config.PlatformSpecificParams = defaultPlatformSpecificParams()
|
||||
}
|
||||
switch config.DeviceType {
|
||||
case TUN:
|
||||
return newTUN(config)
|
||||
case TAP:
|
||||
return newTAP(config)
|
||||
case TUN, TAP:
|
||||
return openDev(config)
|
||||
default:
|
||||
return nil, errors.New("unknown device type")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue