Skip to content

Commit

Permalink
diag_arp allow underscore in resolved host names
Browse files Browse the repository at this point in the history
is_hostname() and is_domain() allow underscore in the names. So it is possible to have underscore in host names, for example in DHCP server static mapped entries I have some things like:
10.42.3.4 client-pc-01_LAN
10.42.3.5 client-pc-01_WIFI
These reverse-resolve fine - 10.42.3.4 becomes client-pc-01_LAN
But the preg_match here misses such names that have an underscore in them.
I noticed this when looking into forum post: https://forum.pfsense.org/index.php?topic=88956.0
  • Loading branch information
Phil Davis committed Feb 18, 2015
1 parent 559c8d3 commit 6777fc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usr/local/www/diag_arp.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function _getHostName($mac,$ip) {
return $dhcpip[$ip];
else{
exec("host -W 1 " . escapeshellarg($ip), $output);
if (preg_match('/.*pointer ([A-Za-z0-9.-]+)\..*/',$output[0],$matches)) {
if (preg_match('/.*pointer ([A-Za-z_0-9.-]+)\..*/',$output[0],$matches)) {
if ($matches[1] <> $ip)
return $matches[1];
}
Expand Down

0 comments on commit 6777fc3

Please sign in to comment.