From 67381d7aaf169ea76a903e03f5f5676db4d74b4c Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 2 Aug 2011 22:34:12 +0000 Subject: If the interface is changed stop previous running snort on the other interface --- config/snort/snort_interfaces_edit.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'config') diff --git a/config/snort/snort_interfaces_edit.php b/config/snort/snort_interfaces_edit.php index 0876d06e..cea03ca9 100644 --- a/config/snort/snort_interfaces_edit.php +++ b/config/snort/snort_interfaces_edit.php @@ -270,9 +270,13 @@ if (isset($_GET['dup'])) if ($pconfig['rule_sid_on'] != "") { $natent['rule_sid_on'] = $pconfig['rule_sid_on']; } - if (isset($id) && $a_nat[$id]) + $if_real = snort_get_real_interface($natent['interface']); + + if (isset($id) && $a_nat[$id]) { + if ($natent['interface'] != $a_nat[$id]['interface']) + Running_Stop($snort_uuid, $if_real, $id); $a_nat[$id] = $natent; - else { + } else { if (is_numeric($after)) array_splice($a_nat, $after+1, 0, array($natent)); else @@ -281,7 +285,6 @@ if (isset($_GET['dup'])) write_config(); - $if_real = snort_get_real_interface($natent['interface']); sync_snort_package_all($id, $if_real, $snort_uuid); sleep(1); @@ -367,17 +370,6 @@ function enable_change(enable_change) { endis = !(document.iform.enable.checked || enable_change); // make shure a default answer is called if this is envoked. endis2 = (document.iform.enable); - - document.iform.performance.disabled = endis; document.iform.blockoffenders7.disabled = endis; document.iform.alertsystemlog.disabled = endis; -- cgit v1.2.3