mirror of
https://github.com/openwrt/luci.git
synced 2025-12-21 21:24:35 +04:00
luci-proto-wireguard: fixed incorrect peer detection for ipv6 and default port
Fixed incorrect peer detection if IP v6 is used and no port for peer is defined. Signed-off-by: Tom Haley <this_username_has_been_taken2@proton.me>
This commit is contained in:
@@ -23,7 +23,7 @@ function checkPeerHost(configHost, configPort, wgHost) {
|
|||||||
const ip = rtrim(line, '\n');
|
const ip = rtrim(line, '\n');
|
||||||
if (configPort && (ip + ":" + configPort == hostIp)) {
|
if (configPort && (ip + ":" + configPort == hostIp)) {
|
||||||
return true;
|
return true;
|
||||||
} else if (ip == substr(hostIp, 0, index(hostIp, ":"))) {
|
} else if (ip == substr(hostIp, 0, rindex(hostIp, ":"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user