summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_ipsec_sad.php
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2014-11-24 21:54:00 +0100
committerErmal LUÇI <eri@pfsense.org>2014-11-24 21:54:00 +0100
commitf07008f559059d5f3da9bc702d19a9c8aa7c18f7 (patch)
tree042b88392cf3331acbc8461c9a4b4c12274194c7 /usr/local/www/diag_ipsec_sad.php
parentec5753e7563c31e843a503d17f78487a2d156c78 (diff)
downloadpfsense-f07008f559059d5f3da9bc702d19a9c8aa7c18f7.zip
pfsense-f07008f559059d5f3da9bc702d19a9c8aa7c18f7.tar.gz
Fixes #4037
Revert "Do not let the user mess with SAs from this page. The daemon and primary status page handles tat" This reverts commit bb55330aca91eb556df4ab7a21fe42d1d7899f8e.
Diffstat (limited to 'usr/local/www/diag_ipsec_sad.php')
-rw-r--r--usr/local/www/diag_ipsec_sad.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/usr/local/www/diag_ipsec_sad.php b/usr/local/www/diag_ipsec_sad.php
index 77a72fc..2628f64 100644
--- a/usr/local/www/diag_ipsec_sad.php
+++ b/usr/local/www/diag_ipsec_sad.php
@@ -53,6 +53,16 @@ include("head.inc");
$sad = ipsec_dump_sad();
+/* delete any SA? */
+if ($_GET['act'] == "del") {
+ $fd = @popen("/sbin/setkey -c > /dev/null 2>&1", "w");
+ if ($fd) {
+ fwrite($fd, "delete {$_GET['src']} {$_GET['dst']} {$_GET['proto']} {$_GET['spi']} ;\n");
+ pclose($fd);
+ sleep(1);
+ }
+}
+
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
@@ -96,6 +106,15 @@ $sad = ipsec_dump_sad();
<td class="listr"><?=htmlspecialchars($sa['aalgo']);?></td>
<td class="listr"><?=htmlspecialchars($sa['data']);?></td>
<td class="list nowrap">
+ <?php
+ $args = "src=" . rawurlencode($sa['src']);
+ $args .= "&amp;dst=" . rawurlencode($sa['dst']);
+ $args .= "&amp;proto=" . rawurlencode($sa['proto']);
+ $args .= "&amp;spi=" . rawurlencode("0x" . $sa['spi']);
+ ?>
+ <a href="diag_ipsec_sad.php?act=del&amp;<?=$args;?>" onclick="return confirm('<?=gettext("Do you really want to delete this security association?"); ?>')">
+ <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" />
+ </a>
</td>
</tr>
<?php endforeach; ?>
OpenPOWER on IntegriCloud