summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-08-05 11:58:14 -0300
committerRenato Botelho <renato@netgate.com>2016-08-05 11:58:50 -0300
commit05741e4540267134f4a2faf91ed53bf42d41896b (patch)
treeb04f3aff1d160f3b6e50c8f0580fad2d9314eaea /src/etc
parent802029ced80085e650d11c1993fbf71c0bd52e6b (diff)
downloadpfsense-05741e4540267134f4a2faf91ed53bf42d41896b.zip
pfsense-05741e4540267134f4a2faf91ed53bf42d41896b.tar.gz
Verify if interface is active gw for gw group before update dynamic DNS
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/inc/services.inc28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc
index 0fe612c..6887c86 100644
--- a/src/etc/inc/services.inc
+++ b/src/etc/inc/services.inc
@@ -1982,7 +1982,19 @@ function services_dyndns_configure($int = "") {
}
foreach ($dyndnscfg as $dyndns) {
- if ((empty($int)) || ($int == $dyndns['interface']) || (is_array($gwgroups[$dyndns['interface']]))) {
+ /*
+ * If it's using a gateway group, check if interface is
+ * the active gateway for that group
+ */
+ $group_int = '';
+ if (is_array($gwgroups[$dyndns['interface']])) {
+ if (!empty($gwgroups[$dyndns['interface']][0]['vip'])) {
+ $group_int = $gwgroups[$dyndns['interface']][0]['vip'];
+ } else {
+ $group_int = $gwgroups[$dyndns['interface']][0]['int'];
+ }
+ }
+ if ((empty($int)) || ($int == $dyndns['interface']) || ($int == $group_int)) {
$dyndns['verboselog'] = isset($dyndns['verboselog']);
$dyndns['curl_ipresolve_v4'] = isset($dyndns['curl_ipresolve_v4']);
$dyndns['curl_ssl_verifypeer'] = isset($dyndns['curl_ssl_verifypeer']);
@@ -2461,7 +2473,19 @@ function services_dnsupdate_process($int = "", $updatehost = "", $forced = false
if (!isset($dnsupdate['enable'])) {
continue;
}
- if (!empty($int) && ($int != $dnsupdate['interface']) && (!is_array($gwgroups[$dnsupdate['interface']]))) {
+ /*
+ * If it's using a gateway group, check if interface is
+ * the active gateway for that group
+ */
+ $group_int = '';
+ if (is_array($gwgroups[$dnsupdate['interface']])) {
+ if (!empty($gwgroups[$dnsupdate['interface']][0]['vip'])) {
+ $group_int = $gwgroups[$dnsupdate['interface']][0]['vip'];
+ } else {
+ $group_int = $gwgroups[$dnsupdate['interface']][0]['int'];
+ }
+ }
+ if (!empty($int) && ($int != $dnsupdate['interface']) && ($int != $group_int)) {
continue;
}
if (!empty($updatehost) && ($updatehost != $dnsupdate['host'])) {
OpenPOWER on IntegriCloud