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:
@@ -19,10 +19,11 @@ func Test_modifyConfig(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCases := map[string]struct {
|
||||
lines []string
|
||||
settings settings.OpenVPN
|
||||
connection models.Connection
|
||||
modified []string
|
||||
lines []string
|
||||
settings settings.OpenVPN
|
||||
connection models.Connection
|
||||
ipv6Supported bool
|
||||
modified []string
|
||||
}{
|
||||
"mixed": {
|
||||
lines: []string{
|
||||
@@ -49,6 +50,7 @@ func Test_modifyConfig(t *testing.T) {
|
||||
Port: 1194,
|
||||
Protocol: constants.UDP,
|
||||
},
|
||||
ipv6Supported: false,
|
||||
modified: []string{
|
||||
"up bla",
|
||||
"keep me here",
|
||||
@@ -82,7 +84,7 @@ func Test_modifyConfig(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
modified := modifyConfig(testCase.lines,
|
||||
testCase.connection, testCase.settings)
|
||||
testCase.connection, testCase.settings, testCase.ipv6Supported)
|
||||
|
||||
assert.Equal(t, testCase.modified, modified)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user