diff options
author | Renato Botelho <renato@netgate.com> | 2016-08-05 11:58:14 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-08-05 11:58:43 -0300 |
commit | e8382f7fda9e09e4c94b6833ff20ebc7101d1b6f (patch) | |
tree | 690a4172eeca867e549f83a3439da3fccd0c4057 | |
parent | 77413c25d20fa32b93b6226e889af540e97fd950 (diff) | |
download | pfsense-e8382f7fda9e09e4c94b6833ff20ebc7101d1b6f.zip pfsense-e8382f7fda9e09e4c94b6833ff20ebc7101d1b6f.tar.gz |
Verify if interface is active gw for gw group before update dynamic DNS
-rw-r--r-- | src/etc/inc/services.inc | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc index a5d4a71..152eddc 100644 --- a/src/etc/inc/services.inc +++ b/src/etc/inc/services.inc @@ -1950,7 +1950,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']); @@ -2450,7 +2462,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'])) { |