diff options
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 731d42a..4300d2e 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1616,26 +1616,14 @@ function interface_carp_configure(&$vip) { return; } - /* ensure CARP IP really exists prior to loading up */ - /* XXX: this can be bound to only the interface choosen in the carp creation. Not yet since upgrade is needed! */ - $found = false; - $iflist = get_configured_interface_list(); - foreach($iflist as $if) { - $ww_subnet_ip = get_interface_ip($if); - $ww_subnet_bits = get_interface_subnet($if); - if (ip_in_subnet($vip['subnet'], gen_subnet($ww_subnet_ip, $ww_subnet_bits) . "/" . $ww_subnet_bits)) { - $found = true; - break; - } - } - if($found == false) { + /* Ensure CARP IP really exists prior to loading up. */ + $ww_subnet_ip = find_interface_ip($realif); + $ww_subnet_bits = find_interface_subnet($realif); + if (!ip_in_subnet($vip['subnet'], gen_subnet($ww_subnet_ip, $ww_subnet_bits) . "/" . $ww_subnet_bits)) { file_notice("CARP", "Sorry but we could not find a matching real interface subnet for the virtual IP address {$vip['subnet']}.", "Firewall: Virtual IP", ""); return; } - /* invalidate interface cache */ - get_interface_arr(true); - /* create the carp interface and setup */ if (does_interface_exist($vipif)) { pfSense_interface_flags($vipif, -IFF_UP); |