Project

General

Profile

Actions

Bug #13318

closed

Neighbor hostnames in the NDP Table on ``diag_ndp.php`` are always empty

Added by JohnPoz _ over 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Diagnostics
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.01
Release Notes:
Default
Affected Version:
Affected Architecture:

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

ndptable.jpg (66.9 KB) ndptable.jpg JohnPoz _, 06/29/2022 07:31 AM
fixed.jpg (59.4 KB) fixed.jpg JohnPoz _, 06/29/2022 12:16 PM
clipboard-202207021056-wabip.png (16.1 KB) clipboard-202207021056-wabip.png Lev Prokofev, 07/02/2022 02:56 AM
Actions #1

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.

Actions #2

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.

Actions #3

Updated by Jim Pingle over 2 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by JohnPoz _ over 2 years ago

Jim - just to let you know, applied this and seems to be working now. Thanks for such a quick response!

Actions #6

Updated by Jim Pingle over 2 years ago

  • Status changed from Feedback to Resolved
Actions #7

Updated by Jim Pingle about 2 years ago

  • Plus Target Version changed from 22.11 to 23.01
Actions #8

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.

Actions

Also available in: Atom PDF