diff options
author | Warren Baker <warren@decoy.co.za> | 2010-11-18 22:43:08 +0200 |
---|---|---|
committer | Warren Baker <warren@decoy.co.za> | 2010-11-18 22:43:08 +0200 |
commit | df332357f43ba0e624539748d22a8bf1b60dac20 (patch) | |
tree | d87df73b29fe06862be89b1748a69dd337f0710f /config | |
parent | 6a5886839e5ad9c0aa0697d44553336ba32b804e (diff) | |
download | pfsense-packages-df332357f43ba0e624539748d22a8bf1b60dac20.tar.gz pfsense-packages-df332357f43ba0e624539748d22a8bf1b60dac20.tar.bz2 pfsense-packages-df332357f43ba0e624539748d22a8bf1b60dac20.zip |
Listen on CARP VIPs that are associated to the interfaces that have been selected.
Diffstat (limited to 'config')
-rw-r--r-- | config/unbound/unbound.inc | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc index 3d4bc529..2b3b30b0 100644 --- a/config/unbound/unbound.inc +++ b/config/unbound/unbound.inc @@ -28,6 +28,7 @@ if(!function_exists("get_dns_servers")) if(!function_exists("get_nameservers")) require_once("system.inc"); + function unbound_initial_setup() { global $config; @@ -204,17 +205,31 @@ function unbound_get_network_interface_addresses($subnet=false, $mask=false) { $unboundrealif = convert_friendly_interface_to_real_interface_name($unboundif); $unboundip = find_interface_ip($unboundrealif); $ipmask = find_interface_subnet($unboundrealif); + // If $subnet is passed then calculate the beginning of the network range for the IP address if ($subnet) $network = gen_subnet($unboundip, $ipmask); else $network = $unboundip; - if ($mask) + + if ($mask) $unbound_interfaces[] = "$network/$ipmask"; - else - $unbound_interfaces[] = "$network"; - } + else { + $unbound_interfaces[] = $network; + // Check for CARP addresses and also return those + if (isset($config['virtualip'])) { + foreach($config['virtualip']['vip'] as $vip) { + if (($vip['interface'] == $unboundif) && ($vip['mode'] == "carp")) { + $virtual_ip = find_interface_ip(link_ip_to_carp_interface($vip['subnet'])); + $unbound_interfaces[] = $virtual_ip; + } + } + } + } + } + return $unbound_interfaces; + } function unbound_resync_config() { |