diff options
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/diag_ipsec.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr/local/www/diag_ipsec.php b/usr/local/www/diag_ipsec.php index 7e00e3c..01c7c7e 100644 --- a/usr/local/www/diag_ipsec.php +++ b/usr/local/www/diag_ipsec.php @@ -53,12 +53,14 @@ include("head.inc"); require("ipsec.inc"); if ($_GET['act'] == "connect") { - if (is_ipaddr($_GET['remoteid']) && is_ipaddr($_GET['source'])) { + if (is_ipaddrv4($_GET['remoteid']) && is_ipaddrv4($_GET['source'])) { exec("/sbin/ping -S " . escapeshellarg($_GET['source']) . " -c 1 " . escapeshellarg($_GET['remoteid'])); } + else if (is_ipaddrv6($_GET['remoteid']) && is_ipaddrv6($_GET['source'])) { + exec("/sbin/ping6 -S " . escapeshellarg($_GET['source']) . " -c 1 " . escapeshellarg($_GET['remoteid'])); + } } - if ($_GET['act'] == "disconnect") { if (!empty($_GET['user'])) { ipsec_disconnect_mobile($_GET['user']); @@ -164,14 +166,17 @@ $mobile = ipsec_dump_mobile(); } } if ($ip_interface) { - $source = get_interface_ip($ip_interface); + if (is_ipaddrv6($ph2ent['localid']['address'])) + $source = get_interface_ipv6($ip_interface); + else + $source = get_interface_ip($ip_interface); } else if ($ip_alias) { $source = $ip_alias['subnet']; } ?> <?php if (($ph2ent['remoteid']['type'] != "mobile") && ($icon != "pass") && ($source != "")): ?> <center> - <a href="diag_ipsec.php?act=connect&remoteid=<?php echo $ph2ent['remoteid']['address']; ?>&source=<?php echo $source; ?>"> + <a href="diag_ipsec.php?act=connect&remoteid=<?php echo $ph2ent['remoteid']['address']; ?>&source=<?php echo $source; ?>"> <img src ="/themes/<?php echo $g['theme']; ?>/images/icons/icon_service_start.gif" alt="Connect VPN" title="Connect VPN" border="0"> </a> </center> |