default tun name for windows
This commit is contained in:
@ -10,12 +10,19 @@ import (
|
|||||||
tun_util "github.com/go-gost/x/internal/util/tun"
|
tun_util "github.com/go-gost/x/internal/util/tun"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
defaultTunName = "wintun"
|
||||||
|
)
|
||||||
|
|
||||||
func (l *tunListener) createTun() (ifce io.ReadWriteCloser, name string, ip net.IP, err error) {
|
func (l *tunListener) createTun() (ifce io.ReadWriteCloser, name string, ip net.IP, err error) {
|
||||||
ip, ipNet, err := net.ParseCIDR(l.md.config.Net)
|
ip, ipNet, err := net.ParseCIDR(l.md.config.Net)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if l.md.config.Name == "" {
|
||||||
|
l.md.config.Name = defaultTunName
|
||||||
|
}
|
||||||
ifce, name, err = l.createTunDevice()
|
ifce, name, err = l.createTunDevice()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user