fix(openvpn/extract): restrict custom openvpn config protocol to tcp or udp internally

- Fix #3179
- I believe specifying tcp4, tcp6 or tcp-client does not change anything versus tcp + remote ip address
- I believe specifying udp4 or udp6 does not change anything versus tcp + remote ip address
- Simplify firewall code to not account for tcp-client etc.
This commit is contained in:
Quentin McGaw
2026-03-04 18:58:33 +00:00
parent e7b25a0d5e
commit c6c3a2bf1b
3 changed files with 24 additions and 20 deletions
+2 -2
View File
@@ -105,7 +105,7 @@ func Test_extractDataFromLine(t *testing.T) {
},
"tcp-client": {
line: "proto tcp-client",
protocol: "tcp-client",
protocol: constants.TCP,
},
"extract remote error": {
line: "remote bad",
@@ -239,7 +239,7 @@ func Test_extractRemote(t *testing.T) {
},
"invalid protocol": {
line: "remote 1.2.3.4 8000 bad",
err: errors.New("network protocol not supported: bad"),
err: errors.New("parsing protocol from remote line: network protocol not supported: bad"),
},
"IP host and port and protocol": {
line: "remote 1.2.3.4 8000 udp",