diff options
author | Ermal <eri@pfsense.org> | 2014-10-06 08:21:24 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2014-10-06 08:21:24 +0000 |
commit | 4aa7f542a3d14fa59e2949df6e5cec790e8f4141 (patch) | |
tree | 2e3c9605b05fd29b3fa2748bd91d079b56b4739c /etc/inc | |
parent | 042f0d12b36835a085274336244f7e7ecb259900 (diff) | |
parent | 80a261a27ebafe66c221b96086f128ec309fd238 (diff) | |
download | pfsense-4aa7f542a3d14fa59e2949df6e5cec790e8f4141.zip pfsense-4aa7f542a3d14fa59e2949df6e5cec790e8f4141.tar.gz |
Merge pull request #1303 from PiBa-NL/carp_without_matching_subnet
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/interfaces.inc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index a51d8be..84caee2 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2184,19 +2184,17 @@ function interface_carp_configure(&$vip) { } if (is_ipaddrv4($vip['subnet'])) { - /* Ensure CARP IP really exists prior to loading up. */ + /* Ensure a IP on this interface exists prior to configuring CARP. */ $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) && !ip_in_interface_alias_subnet($vip['interface'], $vip['subnet'])) { - file_notice("CARP", sprintf(gettext("Sorry but we could not find a matching real interface subnet for the virtual IP address %s."), $vip['subnet']), "Firewall: Virtual IP", ""); + if (!is_ipaddrv4($ww_subnet_ip)) { + file_notice("CARP", sprintf(gettext("Sorry but we could not find a required assigned ip address on the interface for the virtual IP address %s."), $vip['subnet']), "Firewall: Virtual IP", ""); return; } } else if (is_ipaddrv6($vip['subnet'])) { - /* Ensure CARP IP really exists prior to loading up. */ + /* Ensure a IP on this interface exists prior to configuring CARP. */ $ww_subnet_ip = find_interface_ipv6($realif); - $ww_subnet_bits = find_interface_subnetv6($realif); - if (!ip_in_subnet($vip['subnet'], gen_subnetv6($ww_subnet_ip, $ww_subnet_bits) . "/" . $ww_subnet_bits) && !ip_in_interface_alias_subnet($vip['interface'], $vip['subnet'])) { - file_notice("CARP", sprintf(gettext("Sorry but we could not find a matching real interface subnet for the virtual IPv6 address %s."), $vip['subnet']), "Firewall: Virtual IP", ""); + if (!is_ipaddrv6($ww_subnet_ip)) { + file_notice("CARP", sprintf(gettext("Sorry but we could not find a required assigned ip address on the interface for the virtual IPv6 address %s."), $vip['subnet']), "Firewall: Virtual IP", ""); return; } } @@ -2221,7 +2219,7 @@ function interface_carp_configure(&$vip) { if (is_ipaddrv4($vip['subnet'])) mwexec("/sbin/ifconfig {$realif} " . escapeshellarg($vip['subnet']) . "/" . escapeshellarg($vip['subnet_bits']) . " alias vhid " . escapeshellarg($vip['vhid'])); else if (is_ipaddrv6($vip['subnet'])) - mwexec("/sbin/ifconfig {$realif} inet6 " . escapeshellarg($vip['subnet']) . " prefixlen " . escapeshellarg($vip['subnet_bits']) . " vhid " . escapeshellarg($vip['vhid'])); + mwexec("/sbin/ifconfig {$realif} inet6 " . escapeshellarg($vip['subnet']) . " prefixlen " . escapeshellarg($vip['subnet_bits']) . " alias vhid " . escapeshellarg($vip['vhid'])); return $realif; } @@ -4494,6 +4492,7 @@ function find_number_of_created_carp_interfaces() { } function get_all_carp_interfaces() { + trigger_error("Broken function get_all_carp_interfaces() called. Remo", E_USER_NOTICE); $ints = str_replace("\n", " ", `ifconfig | grep "carp:" -B2 | grep ": flag" | cut -d: -f1`); $ints = explode(" ", $ints); return $ints; |