From 46583aba3a382c28fb6bc4bbbcd7dbf28fe38782 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 11 Sep 2017 17:40:09 -0300 Subject: Fix #7719 When Dynamic DNS entry uses a gateway group as interface, return_gateway_groups_array() will be called and it returns real interface instead of friendly name, as expected. Take both friendly and real interface name into consideration. --- src/etc/inc/services.inc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/etc') diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc index 79a12db..132121b 100644 --- a/src/etc/inc/services.inc +++ b/src/etc/inc/services.inc @@ -1983,14 +1983,19 @@ function services_dyndns_configure($int = "") { * the active gateway for that group */ $group_int = ''; + $friendly_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']; + $friendly_group_int = + convert_real_interface_to_friendly_name( + $group_int); } } - if ((empty($int)) || ($int == $dyndns['interface']) || ($int == $group_int)) { + if ((empty($int)) || ($int == $dyndns['interface']) || + ($int == $group_int) || ($int == $friendly_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']); @@ -2541,14 +2546,19 @@ function services_dnsupdate_process($int = "", $updatehost = "", $forced = false * the active gateway for that group */ $group_int = ''; + $friendly_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']; + $friendly_group_int = + convert_real_interface_to_friendly_name( + $group_int); } } - if (!empty($int) && ($int != $dnsupdate['interface']) && ($int != $group_int)) { + if (!empty($int) && ($int != $dnsupdate['interface']) && + ($int != $group_int) && ($int != $friendly_group_int)) { continue; } if (!empty($updatehost) && ($updatehost != $dnsupdate['host'])) { -- cgit v1.1