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:59:06 -0300 |
commit | 8dc9052542c23681d2ee944cfd18463eb3eb6634 (patch) | |
tree | 372ef75379e75dddda8fbfb58edd94588dd77708 | |
parent | 72f91833a5fc41b4d0182e0d2e42342154c4df8c (diff) | |
download | pfsense-8dc9052542c23681d2ee944cfd18463eb3eb6634.zip pfsense-8dc9052542c23681d2ee944cfd18463eb3eb6634.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 947ff98..db617bf 100644 --- a/src/etc/inc/services.inc +++ b/src/etc/inc/services.inc @@ -1977,7 +1977,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']); @@ -2456,7 +2468,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'])) { |