mirror of
https://github.com/openwrt/luci.git
synced 2025-12-21 21:24:35 +04:00
luci-proto-wireguard: Escape IPv6 endpoints with [] in generated wireguard config
Signed-off-by: Jonathan Duncan <JonathanDuncan@gmail.com>
This commit is contained in:
@@ -700,6 +700,11 @@ return network.registerProtocol('wireguard', {
|
|||||||
eport = this.section.formvalue(section_id, 'endpoint_port'),
|
eport = this.section.formvalue(section_id, 'endpoint_port'),
|
||||||
keep = this.section.formvalue(section_id, 'persistent_keepalive');
|
keep = this.section.formvalue(section_id, 'persistent_keepalive');
|
||||||
|
|
||||||
|
// If endpoint is IPv6 we must escape it with []
|
||||||
|
if (endpoint.indexOf(':') > 0) {
|
||||||
|
endpoint = '['+endpoint+']';
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'[Interface]',
|
'[Interface]',
|
||||||
'PrivateKey = ' + prv,
|
'PrivateKey = ' + prv,
|
||||||
|
|||||||
Reference in New Issue
Block a user