Commit c87882e5 authored by Max Lv's avatar Max Lv

Fully disable IPv6 resolving in IPv4 mode, #890

parent 8f80fbfd
...@@ -192,15 +192,15 @@ class ShadowsocksNatService extends BaseService { ...@@ -192,15 +192,15 @@ class ShadowsocksNatService extends BaseService {
val conf = profile.route match { val conf = profile.route match {
case Route.BYPASS_CHN | Route.BYPASS_LAN_CHN => { case Route.BYPASS_CHN | Route.BYPASS_LAN_CHN => {
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
"127.0.0.1", profile.localPort + 53, getBlackList, profile.localPort + 63, "") "127.0.0.1", profile.localPort + 53, getBlackList, "", profile.localPort + 63, "")
} }
case Route.GFWLIST => { case Route.GFWLIST => {
ConfigUtils.PDNSD_UDP.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, ConfigUtils.PDNSD_UDP.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
"127.0.0.1", profile.localPort + 53, "1.2.4.8, 208.67.222.222", profile.localPort + 63, "") "127.0.0.1", profile.localPort + 53, "1.2.4.8, 208.67.222.222", "", profile.localPort + 63, "")
} }
case Route.CHINALIST => { case Route.CHINALIST => {
ConfigUtils.PDNSD_UDP.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, ConfigUtils.PDNSD_UDP.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
"127.0.0.1", profile.localPort + 53, "8.8.8.8, 208.67.222.222", profile.localPort + 63, "") "127.0.0.1", profile.localPort + 53, "8.8.8.8, 208.67.222.222", "", profile.localPort + 63, "")
} }
case _ => { case _ => {
ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
......
...@@ -311,15 +311,15 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -311,15 +311,15 @@ class ShadowsocksVpnService extends VpnService with BaseService {
val conf = profile.route match { val conf = profile.route match {
case Route.BYPASS_CHN | Route.BYPASS_LAN_CHN => { case Route.BYPASS_CHN | Route.BYPASS_LAN_CHN => {
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
"0.0.0.0", profile.localPort + 53, getBlackList, profile.localPort + 63, ipv6) "0.0.0.0", profile.localPort + 53, getBlackList, ipv6, profile.localPort + 63, ipv6)
} }
case Route.GFWLIST => { case Route.GFWLIST => {
ConfigUtils.PDNSD_UDP.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, ConfigUtils.PDNSD_UDP.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
"0.0.0.0", profile.localPort + 53, "1.2.4.8, 208.67.222.222", profile.localPort + 63, "") "0.0.0.0", profile.localPort + 53, "1.2.4.8, 208.67.222.222", ipv6, profile.localPort + 63, ipv6)
} }
case Route.CHINALIST => { case Route.CHINALIST => {
ConfigUtils.PDNSD_UDP.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, ConfigUtils.PDNSD_UDP.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
"0.0.0.0", profile.localPort + 53, "8.8.8.8, 208.67.222.222", profile.localPort + 63, ipv6) "0.0.0.0", profile.localPort + 53, "8.8.8.8, 208.67.222.222", ipv6, profile.localPort + 63, ipv6)
} }
case _ => { case _ => {
ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir, ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
......
...@@ -122,6 +122,9 @@ object ConfigUtils { ...@@ -122,6 +122,9 @@ object ConfigUtils {
| policy = included; | policy = included;
| uptest = none; | uptest = none;
| preset = on; | preset = on;
| %s
| reject_policy = negate;
| reject_recursively = on;
|} |}
| |
|server { |server {
...@@ -163,6 +166,9 @@ object ConfigUtils { ...@@ -163,6 +166,9 @@ object ConfigUtils {
| timeout = 5; | timeout = 5;
| uptest = none; | uptest = none;
| preset = on; | preset = on;
| %s
| reject_policy = negate;
| reject_recursively = on;
|} |}
| |
|server { |server {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment