diff options
-rw-r--r-- | protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js | 5 |
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, |