summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-09-25 09:22:19 +0200
committerGitHub <noreply@github.com>2023-09-25 09:22:19 +0200
commit2a09ea0003f2c8aa08da32c7109eec138294fb08 (patch)
tree754c8cc225818ce8c80ddb8e3457565689bd8df9
parentd7e905e83a11d59ea217cd37189040bd6c9d403e (diff)
parent527453ff4851a0594f804aa2c572e820706827c8 (diff)
Merge pull request #6593 from Kasoo/luci-proto-wireguard/ipv6_endpoint_config
luci-proto-wireguard: Escape IPv6 endpoints with [] in generated wireguard config
-rw-r--r--protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
index fc28d2bbe5..58537f38f8 100644
--- a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
+++ b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
@@ -700,6 +700,11 @@ return network.registerProtocol('wireguard', {
eport = this.section.formvalue(section_id, 'endpoint_port'),
keep = this.section.formvalue(section_id, 'persistent_keepalive');
+ // If endpoint is IPv6 we must escape it with []
+ if (endpoint.indexOf(':') > 0) {
+ endpoint = '['+endpoint+']';
+ }
+
return [
'[Interface]',
'PrivateKey = ' + prv,