diff options
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/captiveportal.inc | 17 | ||||
-rw-r--r-- | etc/inc/filter.inc | 17 |
2 files changed, 14 insertions, 20 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 074b0dc..3d29791 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -499,18 +499,15 @@ function captiveportal_init_rules($reinit = false) { if (!empty($tmpif)) { $cpipm = get_interface_ip($cpifgrp); if (is_ipaddr($cpipm)) { - $carpif = link_ip_to_carp_interface($cpipm); - if (!empty($carpif)) { - $carpsif = explode(" ", $carpif); - foreach ($carpsif as $cpcarp) { - mwexec("/sbin/ipfw zone {$cpzoneid} madd {$cpcarp}", true); - $carpip = find_interface_ip($cpcarp); - if (is_ipaddr($carpip)) { - $cpips[] = $carpip; - } + $cpips[] = $cpipm; + if (!is_array($config['virtualip']) || !is_array($config['virtualip']['vip'])) { + continue; + } + foreach ($config['virtualip']['vip'] as $vip) { + if (($vip['interface'] == $cpifgrp) && (($vip['mode'] == "carp") || ($vip['mode'] == "ipalias"))) { + $cpips[] = $vip['subnet']; } } - $cpips[] = $cpipm; } mwexec("/sbin/ipfw zone {$cpzoneid} madd {$tmpif}", true); } diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 469903a..73614f8 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -3240,18 +3240,15 @@ EOD; $cpiflist[] = "{$tmpif}"; $cpipm = get_interface_ip($cpifgrp); if (is_ipaddr($cpipm)) { - $carpif = link_ip_to_carp_interface($cpipm); - if (!empty($carpif)) { - $cpiflist[] = $carpif; - $carpsif = explode(" ", $carpif); - foreach ($carpsif as $cpcarp) { - $carpip = find_interface_ip($cpcarp); - if (is_ipaddr($carpip)) { - $cpiplist[] = $carpip; - } + $cpiplist[] = $cpipm; + if (!is_array($config['virtualip']) || !is_array($config['virtualip']['vip'])) { + continue; + } + foreach ($config['virtualip']['vip'] as $vip) { + if (($vip['interface'] == $cpifgrp) && (($vip['mode'] == "carp") || ($vip['mode'] == "ipalias"))) { + $cpiplist[] = $vip['subnet']; } } - $cpiplist[] = $cpipm; } } } |