mirror of
https://github.com/fumiama/water.git
synced 2026-06-22 12:10:51 +08:00
populate default PlatformSpecificParams when it's empty (#43)
This commit is contained in:
3
if.go
3
if.go
@@ -53,6 +53,9 @@ func New(config Config) (ifce *Interface, err error) {
|
||||
if zeroConfig == config {
|
||||
config = defaultConfig()
|
||||
}
|
||||
if config.PlatformSpecificParams == zeroConfig.PlatformSpecificParams {
|
||||
config.PlatformSpecificParams = defaultPlatformSpecificParams()
|
||||
}
|
||||
switch config.DeviceType {
|
||||
case TUN:
|
||||
return newTUN(config)
|
||||
|
||||
Reference in New Issue
Block a user