Fix remoteDns not used in NAT with UDP disabled

This commit is contained in:
Mygod
2017-01-06 17:13:31 +08:00
parent 0234acbf5f
commit d10acf52ec
2 changed files with 3 additions and 15 deletions
@@ -119,16 +119,10 @@ class ShadowsocksNatService extends BaseService {
, "-t" , "10"
, "-b" , "127.0.0.1"
, "-l" , (profile.localPort + 53).toString
, "-L" , if (profile.remoteDns == null) "8.8.8.8:53" else profile.remoteDns + ":53"
, "-P" , getApplicationInfo.dataDir
, "-c" , getApplicationInfo.dataDir + "/ss-tunnel-nat.conf")
cmd += "-L"
if (profile.remoteDns == null)
cmd += "8.8.8.8:53"
else
cmd += profile.remoteDns + ":53"
if (profile.auth) cmd += "-A"
if (BuildConfig.DEBUG) Log.d(TAG, cmd.mkString(" "))
@@ -152,7 +146,7 @@ class ShadowsocksNatService extends BaseService {
, "-t" , "10"
, "-b" , "127.0.0.1"
, "-l" , (profile.localPort + 63).toString
, "-L" , "8.8.8.8:53"
, "-L" , if (profile.remoteDns == null) "8.8.8.8:53" else profile.remoteDns + ":53"
, "-P", getApplicationInfo.dataDir
, "-c" , getApplicationInfo.dataDir + "/ss-tunnel-nat.conf")
@@ -270,16 +270,10 @@ class ShadowsocksVpnService extends VpnService with BaseService {
, "-V"
, "-t", "10"
, "-b", "127.0.0.1"
, "-L" , if (profile.remoteDns == null) "8.8.8.8:53" else profile.remoteDns + ":53"
, "-P", getApplicationInfo.dataDir
, "-c", getApplicationInfo.dataDir + "/ss-tunnel-vpn.conf")
cmd += "-L"
if (profile.remoteDns == null)
cmd += "8.8.8.8:53"
else
cmd += profile.remoteDns + ":53"
if (profile.auth) cmd += "-A"
if (BuildConfig.DEBUG) Log.d(TAG, cmd.mkString(" "))