mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Take routing table into account when figuring out which IP address to use for talking to CP clients.
This commit is contained in:
parent
e2939b79f7
commit
f86fa91cf9
@ -1571,6 +1571,14 @@ function portal_ip_from_client_ip($cliip) {
|
||||
return $ip;
|
||||
}
|
||||
|
||||
$iface = exec_command("/sbin/route -n get {$cliip} | /usr/bin/awk '/interface/ { print \$2; };'");
|
||||
$iface = trim($iface, "\n");
|
||||
if (!empty($iface)) {
|
||||
$ip = find_interface_ip($iface);
|
||||
if (is_ipaddr($ip))
|
||||
return $ip;
|
||||
}
|
||||
|
||||
// doesn't match up to any particular interface
|
||||
// so let's set the portal IP to what PHP says
|
||||
// the server IP issuing the request is.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user