diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-10-05 19:48:31 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-10-05 19:48:31 +0000 |
commit | ae544bacf9a983eaea67493f6207f5788fed41c1 (patch) | |
tree | 2f68f6ff4dc68ffdc4f095b060780d70eecc9dd2 /etc | |
parent | 5b3fe9a221eca294a1e50589ffc419c5353aa705 (diff) | |
download | pfsense-ae544bacf9a983eaea67493f6207f5788fed41c1.zip pfsense-ae544bacf9a983eaea67493f6207f5788fed41c1.tar.gz |
If no virtual ips are defined simply return 0 and avoid a Warning: Invalid argument supplied for foreach() in /etc/inc/pfsense-utils.inc on line 51 warning
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 2311ea7..e0de9a2 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -48,6 +48,10 @@ function get_tmp_file() { function find_number_of_needed_carp_interfaces() { global $config, $g; $carp_counter=0; + if(!$config['virtualip']) + return 0; + if(!$config['virtualip']['vip']) + return 0; foreach($config['virtualip']['vip'] as $vip) { if($vip['mode'] == "carp") $carp_counter++; |