mirror of
https://github.com/openwrt/luci.git
synced 2026-02-04 12:06:01 +08:00
luci-proto-wireguard: fixed incorrect peer detection if port is not set
Fixed incorrect peer detection if port is not set (default port is used) Signed-off-by: Tom Haley <this_username_has_been_taken2@proton.me>
This commit is contained in:
@@ -21,7 +21,9 @@ function checkPeerHost(configHost, configPort, wgHost) {
|
|||||||
if (ips) {
|
if (ips) {
|
||||||
for (let line = ips.read('line'); length(line); line = ips.read('line')) {
|
for (let line = ips.read('line'); length(line); line = ips.read('line')) {
|
||||||
const ip = rtrim(line, '\n');
|
const ip = rtrim(line, '\n');
|
||||||
if (ip + ":" + configPort == hostIp) {
|
if (configPort && (ip + ":" + configPort == hostIp)) {
|
||||||
|
return true;
|
||||||
|
} else if (ip == substr(hostIp, 0, index(hostIp, ":"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,7 +31,6 @@ function checkPeerHost(configHost, configPort, wgHost) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const methods = {
|
const methods = {
|
||||||
generatePsk: {
|
generatePsk: {
|
||||||
call: function() {
|
call: function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user