feat(vpn): auto detection of IPv6 support
- `OPENVPN_IPV6` removed - Affects OpenVPN - Use the same mechanism for OpenVPN and Wireguard - Check only once at program start since this is unlikely to change at runtime - Log if IPv6 is supported - Remove `IPv6` boolean from settings structs - Move IPv6 detection as a method on NetLinker
This commit is contained in:
@@ -50,7 +50,7 @@ type OpenVPNProviderSettings struct {
|
||||
//nolint:gocognit,gocyclo
|
||||
func OpenVPNConfig(provider OpenVPNProviderSettings,
|
||||
connection models.Connection,
|
||||
settings settings.OpenVPN) []string {
|
||||
settings settings.OpenVPN, ipv6Supported bool) []string {
|
||||
var lines openvpnConfigLines
|
||||
lines.add("client")
|
||||
lines.add("nobind")
|
||||
@@ -158,7 +158,7 @@ func OpenVPNConfig(provider OpenVPNProviderSettings,
|
||||
lines.add("persist-key")
|
||||
}
|
||||
|
||||
if *settings.IPv6 {
|
||||
if ipv6Supported {
|
||||
lines.add("tun-ipv6")
|
||||
} else {
|
||||
lines.add("pull-filter", "ignore", `"route-ipv6"`)
|
||||
|
||||
Reference in New Issue
Block a user