Skip to content

Commit

Permalink
Merge pull request openwrt#6593 from Kasoo/luci-proto-wireguard/ipv6_…
Browse files Browse the repository at this point in the history
…endpoint_config

luci-proto-wireguard: Escape IPv6 endpoints with [] in generated wireguard config
  • Loading branch information
jow- authored Sep 25, 2023
2 parents d7e905e + 527453f commit 2a09ea0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2a09ea0

Please sign in to comment.