Bug #13318
closedNeighbor hostnames in the NDP Table on ``diag_ndp.php`` are always empty
100%
Description
The NDP Table in the gui is not listing the hostname, while ndp -a from cmd line does.
See this thread.
https://forum.netgate.com/topic/172830/ndp-table-not-showing-hostname
Files
Updated by Jim Pingle over 2 years ago
- Project changed from pfSense Plus to pfSense
- Category changed from Web Interface to Web Interface
- Assignee set to Jim Pingle
- Target version set to 2.7.0
- Affected Plus Version deleted (
22.05) - Plus Target Version set to 22.11
Looks like for some reason _getHostName()
is forcing the DNS lookup to use -6
when it shouldn't, as that controls how the DNS lookup is made to the DNS server, not the type of address being passed.
This seems to fix it for me:
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index 079480c674..28db31a88c 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -2802,8 +2802,7 @@ function _getHostName($mac, $ip) {
} else if ($dhcpip[$ip]) {
return $dhcpip[$ip];
} else {
- $ipproto = (is_ipaddrv4($ip)) ? '-4 ' : '-6 ';
- exec("/usr/bin/host -W 1 " . $ipproto . escapeshellarg($ip), $output);
+ exec("/usr/bin/host -W 1 " . escapeshellarg($ip), $output);
if (preg_match('/.*pointer ([A-Za-z_0-9.-]+)\..*/', $output[0], $matches)) {
if ($matches[1] <> $ip) {
return $matches[1];
I need to look through the history and see why it was trying to pass -4 or -6, there may be some other case where that helps that I'm not seeing, or maybe it was an attempt to fix some other behavior that needs a different approach.
Updated by Jim Pingle over 2 years ago
Looking at #11512 and aa1936eefc251b5330e7392f3b1fbc23a006a400 where that was added, it isn't necessary. There is a place in another function where it was helpful when connecting to a specific DNS server, but this is not connecting to a specific DNS server, just trying to resolve a certain kind of address which doesn't require forcing the DNS request to use a specific address family. I'll commit the change above shortly.
Updated by Jim Pingle over 2 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset 8c9ab20efe61161e30fe215166d8573c801b947d.
Updated by Lev Prokofev over 2 years ago
Seems it works.
Updated by Jim Pingle about 2 years ago
- Plus Target Version changed from 22.11 to 23.01
Updated by Jim Pingle about 2 years ago
- Subject changed from NDP Table not showing hostname to Neighbor hostnames in the NDP Table on ``diag_ndp.php`` are always empty
- Category changed from Web Interface to Diagnostics
Updating subject for release notes.