Fix: iptables routing mark init

This commit is contained in:
gVisor bot 2022-03-03 05:02:17 +08:00
parent 5abb8b4c57
commit dd2ebb5903

View file

@ -192,7 +192,10 @@ func updateGeneral(general *config.General, force bool) {
log.Infoln("Use interface name: %s", general.Interface) log.Infoln("Use interface name: %s", general.Interface)
dialer.DefaultInterface.Store(general.Interface) dialer.DefaultInterface.Store(general.Interface)
if general.RoutingMark > 0 {
dialer.DefaultRoutingMark.Store(int32(general.RoutingMark)) dialer.DefaultRoutingMark.Store(int32(general.RoutingMark))
}
iface.FlushCache() iface.FlushCache()
@ -280,10 +283,7 @@ func updateIPTables(dns *config.DNS, general *config.General) {
tproxy.CleanUpTProxyLinuxIPTables() tproxy.CleanUpTProxyLinuxIPTables()
if dialer.DefaultRoutingMark.Load() == 0 {
dialer.DefaultRoutingMark.Store(2158) dialer.DefaultRoutingMark.Store(2158)
}
err = tproxy.SetTProxyLinuxIPTables(general.Interface, general.TProxyPort, dnsPort) err = tproxy.SetTProxyLinuxIPTables(general.Interface, general.TProxyPort, dnsPort)
if err != nil { if err != nil {