mirror of
https://github.com/openwrt/luci.git
synced 2025-12-21 19:14:34 +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'),
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user