From 2ec2a374685c2141f4825097057a0496a4d45bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Mon, 21 Dec 2009 17:24:53 +0000 Subject: Make dnsupdate runnable per interface. Update the calls on interface_configure to per interface. Remove unused dyndns_reset function. --- etc/inc/interfaces.inc | 4 ++-- etc/inc/services.inc | 43 ++++++++----------------------------------- 2 files changed, 10 insertions(+), 37 deletions(-) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index d140566..d41aad7 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1755,10 +1755,10 @@ function interface_configure($interface = "wan", $reloadall = false) { vpn_ipsec_configure(); /* update dyndns */ - services_dyndns_configure(); + services_dyndns_configure($interface); /* force DNS update */ - services_dnsupdate_process(); + services_dnsupdate_process($interface); /* restart dnsmasq */ services_dnsmasq_configure(); diff --git a/etc/inc/services.inc b/etc/inc/services.inc index e896f81..4c519a6 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -537,32 +537,6 @@ function services_dhcrelay_configure() { return 0; } -function services_dyndns_reset($interface = "wan" ) { - global $config, $g; - if(isset($config['system']['developerspew'])) { - $mt = microtime(); - echo "services_dyndns_reset() being called $mt\n"; - } - - $dyndnscfg = $config['dyndnses']['dyndns']; - - if (is_array($dyndnscfg)) { - foreach ($dyndnscfg as $dyndns) { - if (!isset($dyndns['enable'])) - continue; - if ($dyndns['interface'] != $interface) - continue; - - services_dyndns_configure_client($dyndns); - - sleep(1); - } - - } - - return 0; -} - function services_dyndns_configure_client($conf) { /* load up the dyndns.class */ @@ -849,7 +823,7 @@ EOD; return 0; } -function services_dnsupdate_process() { +function services_dnsupdate_process($int = "") { global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); @@ -859,15 +833,14 @@ function services_dnsupdate_process() { /* Dynamic DNS updating active? */ if (is_array($config['dnsupdates']['dnsupdate'])) { foreach ($config['dnsupdates']['dnsupdate'] as $i => $dnsupdate) { - if (!isset($dyndns['enable'])) + if (!isset($dyndns['enable'])) + continue; + if (!empty($int) && $int != $dyndns['interface']) continue; - /* determine interface name */ - if ($dyndns['interface'] == "wan") - $if = get_real_interface(); - else - $if = convert_friendly_interface_to_real_interface_name($dyndns['interface']); - $wanip = get_interface_ip($if); + /* determine interface name */ + $if = get_real_interface($dyndns['interface']); + $wanip = get_interface_ip($dyndns['interface']); if ($wanip) { $keyname = $dnsupdate['keyname']; @@ -1300,4 +1273,4 @@ function upnp_start() { } } -?> \ No newline at end of file +?> -- cgit v1.1