mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-19 23:24:44 +08:00
update linux tun addr check
This commit is contained in:
@@ -16,5 +16,9 @@ func OpenTunDevice(name, addr, gw, mask string, dnsServers []string) (io.ReadWri
|
||||
return nil, err
|
||||
}
|
||||
name = tunDev.Name()
|
||||
ip := net.ParseIP(addr)
|
||||
if ip == nil {
|
||||
return nil, errors.New("invalid IP address")
|
||||
}
|
||||
return tunDev, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user