summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-02-23 20:11:53 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-02-23 20:11:53 +0000
commit962f7d25d446e15211f38001c3c869dc521b1b11 (patch)
tree84e4e33549d9778a2bb879b9506a3ecb1b1d7a72
parent737ae333e234c54a0b3183baf8daff393ad4809c (diff)
downloadpfsense-962f7d25d446e15211f38001c3c869dc521b1b11.zip
pfsense-962f7d25d446e15211f38001c3c869dc521b1b11.tar.gz
make sure carp interface exists before querying
-rw-r--r--etc/inc/pfsense-utils.inc6
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 1d70aa6..f53f2cc 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -216,6 +216,8 @@ function find_ip_interface($ip) {
* get_carp_interface_status($carpinterface): returns the status of a carp ip
*/
function get_carp_interface_status($carpinterface) {
+ $result = does_interface_exist($carpinterface);
+ if($result <> true) return;
$status = exec_command("/sbin/ifconfig {$carpinterface} | grep \"carp:\" | cut -d\" \" -f2");
return $status;
}
@@ -224,6 +226,8 @@ function get_carp_interface_status($carpinterface) {
* get_pfsync_interface_status($pfsyncinterface): returns the status of a pfsync
*/
function get_pfsync_interface_status($pfsyncinterface) {
+ $result = does_interface_exist($pfsyncinterface);
+ if($result <> true) return;
$status = exec_command("/sbin/ifconfig {$pfsyncinterface} | grep \"pfsync:\" | cut -d\" \" -f5");
return $status;
}
@@ -233,6 +237,8 @@ function get_pfsync_interface_status($pfsyncinterface) {
*/
function find_carp_interface($ip) {
for($x=0; $x<99; $x++) {
+ $result = does_interface_exist("carp{$x}");
+ if($result <> true) return;
$ifconfig = exec_command("/sbin/ifconfig carp{$x}");
if(stristr($ifconfig,$ip))
return "carp" . $x;
OpenPOWER on IntegriCloud