Revision cde88d5e
Added by Ermal Luçi over 10 years ago
etc/inc/vpn.inc | ||
---|---|---|
596 | 596 |
$ifacesuse = get_failover_interface($ph1ent['interface']); |
597 | 597 |
} |
598 | 598 |
|
599 |
if (!empty($ifacesuse) && interface_has_gateway($parentinterface)) {
|
|
599 |
if (!empty($ifacesuse) && interface_has_gateway($ifacesuse)) {
|
|
600 | 600 |
$gatewayip = get_interface_gateway($ifacesuse); |
601 | 601 |
$interfaceip = get_interface_ip($ifacesuse); |
602 | 602 |
$subnet_bits = get_interface_subnet($ifacesuse); |
... | ... | |
604 | 604 |
/* if the remote gateway is in the local subnet, then don't add a route */ |
605 | 605 |
if (!ip_in_subnet($rgip, "{$subnet_ip}/{$subnet_bits}")) { |
606 | 606 |
if (is_ipaddrv4($gatewayip)) { |
607 |
// log_error("IPSEC interface is not WAN but {$parentinterface}, adding static route for VPN endpoint {$rgip} via {$gatewayip}");
|
|
607 |
// log_error("IPSEC interface is not WAN but {$ifacesuse}, adding static route for VPN endpoint {$rgip} via {$gatewayip}");
|
|
608 | 608 |
mwexec("/sbin/route change -host {$rgip} {$gatewayip}", true); |
609 | 609 |
} |
610 | 610 |
} |
... | ... | |
617 | 617 |
$ifacesuse = get_failover_interface($ph1ent['interface']); |
618 | 618 |
} |
619 | 619 |
|
620 |
if (!empty($ifacesuse) && interface_has_gateway($parentinterface)) {
|
|
620 |
if (!empty($ifacesuse) && interface_has_gateway($ifacesuse)) {
|
|
621 | 621 |
$gatewayip = get_interface_gateway_v6($ifacesuse); |
622 | 622 |
$interfaceip = get_interface_ipv6($ifacesuse); |
623 | 623 |
$subnet_bits = get_interface_subnetv6($ifacesuse); |
... | ... | |
625 | 625 |
/* if the remote gateway is in the local subnet, then don't add a route */ |
626 | 626 |
if (!ip_in_subnet($rgip, "{$subnet_ip}/{$subnet_bits}")) { |
627 | 627 |
if (is_ipaddrv6($gatewayip)) { |
628 |
// log_error("IPSEC interface is not WAN but {$parentinterface}, adding static route for VPN endpoint {$rgip} via {$gatewayip}");
|
|
628 |
// log_error("IPSEC interface is not WAN but {$ifacesuse}, adding static route for VPN endpoint {$rgip} via {$gatewayip}");
|
|
629 | 629 |
mwexec("/sbin/route change -inet6 -host {$rgip} {$gatewayip}", true); |
630 | 630 |
} |
631 | 631 |
} |
Also available in: Unified diff
Ticket #4254 Use proper variable