Project

General

Profile

« Previous | Next » 

Revision 0b3052b3

Added by Marcos M over 1 year ago

Clarify function use and description

View differences:

src/etc/inc/system.inc
1225 1225
		if (preg_match('/}$/', $line)) {
1226 1226
			if ($lease) {
1227 1227
				if ($dnsavailable && empty($item['hostname'])) {
1228
					$hostname = check_dnsavailable($item['ip']);
1228
					$hostname = resolve_address($item['ip']);
1229 1229
					if (!empty($hostname)) {
1230 1230
						$item['hostname'] = $hostname;
1231 1231
					}
......
3288 3288
}
3289 3289

  
3290 3290
/**
3291
 * Checks for DNS A/AAAA/SRV/PTR records.
3291
 * Verifies the existence of a DNS A/AAAA/SRV/PTR record for an address.
3292 3292
 * 
3293
 * @param string $address Hostname or IPv4/6 address to check.
3293
 * @param string $address Name or IPv4/6 address to check.
3294 3294
 * 
3295
 * @return string The hostname of the given IP address, or the unmodified address.
3296
 * @return false No DNS records found.
3295
 * @return string The address can be resolved. If $address is an IP address,
3296
 *                return the reverse lookup name, otherwise return the
3297
 *                unmodified input if it's a host/domain name.
3298
 * @return false Cannot resolve - no records found.
3297 3299
 */
3298
function check_dnsavailable(?string $address): string|false {
3300
function resolve_address(?string $address): string|false {
3299 3301
	if (empty($address)) {
3300 3302
		return false;
3301 3303
	}
src/usr/local/pfSense/include/www/diag_arp.inc
68 68
		if (!empty($entry['mac-address']) && isset($namesbymac[$entry['mac-address']])) {
69 69
			$dns = $namesbymac[$entry['mac-address']];
70 70
		} elseif (!empty($entry['ip-address']) && $dnsavailable) {
71
			$dns = check_dnsavailable($entry['ip-address']);
71
			$dns = resolve_address($entry['ip-address']);
72 72
		}
73 73

  
74 74
		if (trim($dns)) {
src/usr/local/www/diag_ndp.php
106 106
foreach ($data as &$entry) {
107 107
	$dns="";
108 108
	if (!empty($entry['ipv6']) && $dnsavailable) {
109
		$dns = check_dnsavailable($entry['ipv6']);
109
		$dns = resolve_address($entry['ipv6']);
110 110
	}
111 111

  
112 112
	if (trim($dns)) {
src/usr/local/www/services_acb.php
230 230

  
231 231
// $confvers must be populated viewing info but there were errors
232 232
$confvers = array();
233
if ((!($_REQUEST['download']) || $input_errors) && check_dnsavailable('acb.netgate.com')) {
233
if ((!($_REQUEST['download']) || $input_errors) && resolve_address('acb.netgate.com')) {
234 234
	// Populate available backups
235 235
	$curl_session = curl_init();
236 236

  

Also available in: Unified diff