Merge remote branch 'upstream/master'

This commit is contained in:
jim-p 2011-06-10 12:37:58 -04:00
commit de408516a8
5 changed files with 45 additions and 12 deletions

View File

@ -408,7 +408,7 @@
* Private Function (added 12 July 2005) [beta]
* Retrieve Update Status
*/
function _checkStatus($data) {
function _checkStatus($ch, $data) {
log_error("DynDns: DynDns _checkStatus() starting.");
log_error("DynDns: Current Service: {$this->_dnsService}");
$successful_update = false;

View File

@ -504,11 +504,13 @@ function filter_expand_alias($alias_name)
}
function filter_generate_aliases() {
global $config, $FilterIflist;
global $config, $FilterIflist, $after_filter_configure_run;
if(isset($config['system']['developerspew'])) {
$mt = microtime();
echo "filter_generate_aliases() being called $mt\n";
}
$alias = "#System aliases\n ";
$aliases = "loopback = \"{ lo0 }\"\n";
@ -554,9 +556,10 @@ function filter_generate_aliases() {
case "network":
case "url":
$tableaddrs = "{$addrlist}{$extralias}";
if(empty($tableaddrs))
if(empty($tableaddrs)) {
$aliases .= "table <{$aliased['name']}> persist\n";
else
$after_filter_configure_run[] = "/sbin/pfctl -T flush -t " . escapeshellarg($aliased['name']);
} else
$aliases .= "table <{$aliased['name']}> { {$addrlist}{$extralias} } \n";
$aliases .= "{$aliased['name']} = \"<{$aliased['name']}>\"\n";

View File

@ -1266,9 +1266,16 @@ function system_ntp_configure() {
$xmlsettings = $config['installedpackages']['openntpd']['config'][0];
if ($xmlsettings['enable'] == 'on') {
$ifaces = explode(',', $xmlsettings['interface']);
$ifaces = array_map('get_real_interface', $ifaces);
$ifaces = array_filter($ifaces, 'does_interface_exist');
$ips = array_map('find_interface_ip', $ifaces);
$ips = array();
foreach ($ifaces as $if) {
if (is_ipaddr($if)) {
$ips[] = $if;
} else {
$if = get_real_interface($if);
if (does_interface_exist($if))
$ips[] = find_interface_ip($if);
}
}
foreach ($ips as $ip) {
if (is_ipaddr($ip))
$ntpcfg .= "listen on $ip\n";
@ -1589,4 +1596,23 @@ function system_get_dmesg_boot() {
return file_get_contents("{$g['varlog_path']}/dmesg.boot");
}
function openntpd_get_listen_ips() {
$interfaces = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list();
$listenips = array();
foreach ($carplist as $cif => $carpip)
$interfaces[$cif] = $carpip." (".get_vip_descr($carpip).")";
$aliaslist = get_configured_ip_aliases_list();
foreach ($aliaslist as $aliasip => $aliasif)
$interfaces[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
foreach ($interfaces as $iface => $ifacename) {
$tmp["name"] = $ifacename;
$tmp["value"] = $iface;
$listenips[] = $tmp;
}
$tmp["name"] = "Localhost";
$tmp["value"] = "lo0";
$listenips[] = $tmp;
return $listenips;
}
?>

View File

@ -15,8 +15,12 @@
<fielddescr>Interface</fielddescr>
<description>Select the interface(s) the NTP server will listen on.</description>
<default_value>lan</default_value>
<type>interfaces_selection</type>
<multiple/>
<type>select_source</type>
<source><![CDATA[openntpd_get_listen_ips()]]></source>
<source_name>name</source_name>
<source_value>value</source_value>
</field>
</fields>
<custom_php_resync_config_command>

View File

@ -198,11 +198,11 @@ function restore_config_section_xmlrpc($raw_params) {
$anyproxyarp = false;
foreach ($config['virtualip']['vip'] as $vip) {
if (isset($oldvips[$vip['vhid']])) {
unset($oldvips[$vip['vhid']]);
if ($oldvips[$vip['vhid']] == "{$vip['password']}{$vip['advskew']}{$vip['subnet']}{$vip['subnet_bits']}{$vip['advbase']}") {
if (does_interface_exist("vip{$vip['vhid']}"))
continue; // Skip reconfiguring this vips since nothing has changed.
} else
unset($oldvips[$vip['vhid']]);
if (does_interface_exist("vip{$vip['vhid']}"))
continue; // Skip reconfiguring this vips since nothing has changed.
}
}
switch ($vip['mode']) {