Chore: cleanup code

This commit is contained in:
yaling888
2022-07-01 18:34:36 +08:00
parent e1fe8ce3b2
commit ae6cc1d67d
25 changed files with 159 additions and 189 deletions

View File

@@ -82,7 +82,7 @@ func ApplyConfig(cfg *config.Config, force bool) {
updateHosts(cfg.Hosts)
updateMitm(cfg.Mitm)
updateProfile(cfg)
updateDNS(cfg.DNS, cfg.General.Tun)
updateDNS(cfg.DNS, &cfg.General.Tun)
updateGeneral(cfg.General, force)
updateIPTables(cfg)
updateExperimental(cfg)
@@ -121,7 +121,7 @@ func GetGeneral() *config.General {
func updateExperimental(_ *config.Config) {}
func updateDNS(c *config.DNS, t config.Tun) {
func updateDNS(c *config.DNS, t *config.Tun) {
cfg := dns.Config{
Main: c.NameServer,
Fallback: c.Fallback,
@@ -179,7 +179,7 @@ func updateDNS(c *config.DNS, t config.Tun) {
}
if cfg.Pool != nil {
P.SetTunAddressPrefix(cfg.Pool.IPNet())
t.TunAddressPrefix = cfg.Pool.IPNet()
}
}