summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/dyndns.class2
-rw-r--r--etc/inc/filter.inc9
-rw-r--r--etc/inc/system.inc32
-rw-r--r--usr/local/pkg/openntpd.xml6
-rwxr-xr-xusr/local/www/xmlrpc.php8
5 files changed, 45 insertions, 12 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class
index 07fdf95..340fbc1 100644
--- a/etc/inc/dyndns.class
+++ b/etc/inc/dyndns.class
@@ -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;
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index a294efc..04f0f47 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -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";
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 6f79f7a..aadcdaa 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -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;
+}
?>
diff --git a/usr/local/pkg/openntpd.xml b/usr/local/pkg/openntpd.xml
index 907c6fb..cefb76d 100644
--- a/usr/local/pkg/openntpd.xml
+++ b/usr/local/pkg/openntpd.xml
@@ -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>
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index 78d1023..1689b85 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -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']) {
OpenPOWER on IntegriCloud