diff options
author | Ermal <eri@pfsense.org> | 2013-02-13 22:40:22 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-02-13 22:40:22 +0000 |
commit | a1e4e2a79fce4c734cf3d8e485531f60da5763e8 (patch) | |
tree | 4726208cfc520ee50772f7d8d593c482bb0e865b /etc/inc/pfsense-utils.inc | |
parent | 72f25519a9ee36cd9c0ba33a3b8736ef0fb7ae26 (diff) | |
download | pfsense-a1e4e2a79fce4c734cf3d8e485531f60da5763e8.zip pfsense-a1e4e2a79fce4c734cf3d8e485531f60da5763e8.tar.gz |
Two interfaces, carp, ip aliases might be on the same subnet as their parent. What needs to be checked is the ip itself
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index bba28dd..47469d8 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -2444,6 +2444,15 @@ function is_ipaddr_configured($ipaddr, $ignore_if = "", $check_localip = false, if (ip_in_subnet($ipaddr, $subnet . '/' . $bitmask)) return true; } + + $interface_list_vips = get_configured_vips_list(true); + foreach ($interface_list_vips as $id => $vip) { + if ($ignore_if == "vip_{$id}") + continue; + if (strcasecmp($ipaddr, $vip['ipaddr']) == 0) + return true; + } + } else { $interface_list_ips = get_configured_ip_addresses(); foreach($interface_list_ips as $if => $ilips) { @@ -2454,19 +2463,11 @@ function is_ipaddr_configured($ipaddr, $ignore_if = "", $check_localip = false, } } - $interface_list_vips = get_configured_vips_list(); - foreach($interface_list_vips as $id => $vip) { - if ($ignore_if == "vip_" . $id) - continue; - if (strcasecmp($ipaddr, $vip['ipaddr']) == 0) - return true; - } - if ($check_localip) { - if (isset($config['pptpd']['localip']) && (strcasecmp($ipaddr, $config['pptpd']['localip']) == 0)) + if (is_array($config['pptpd']) && !empty($config['pptpd']['localip']) && (strcasecmp($ipaddr, $config['pptpd']['localip']) == 0)) return true; - if (isset($config['l2tp']['localip']) && (strcasecmp($ipaddr, $config['l2tp']['localip']) == 0)) + if (!is_array($config['l2tp']) && !empty($config['l2tp']['localip']) && (strcasecmp($ipaddr, $config['l2tp']['localip']) == 0)) return true; } |