mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19:12 +00:00
23 lines
626 B
Go
23 lines
626 B
Go
package firewall
|
|
|
|
import (
|
|
"github.com/safing/portmaster/network"
|
|
"github.com/safing/portmaster/resolver"
|
|
"github.com/safing/spn/navigator"
|
|
)
|
|
|
|
func setCustomTunnelOptionsForPortmaster(conn *network.Connection) {
|
|
switch {
|
|
case !tunnelEnabled():
|
|
// Ignore when tunneling is not enabled.
|
|
return
|
|
case !conn.Entity.IPScope.IsGlobal():
|
|
// Ignore if destination is not in global address space.
|
|
return
|
|
case resolver.IsResolverAddress(conn.Entity.IP, conn.Entity.Port):
|
|
// Set custom tunnel options for DNS servers.
|
|
conn.TunnelOpts = &navigator.Options{
|
|
RoutingProfile: navigator.RoutingProfileHomeName,
|
|
}
|
|
}
|
|
}
|