-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hostname to IPv6 address fails on Windows - Unknown host #304
Comments
If this has not yet been tested with Net-SNMP v5.9.1, please retest with that version. |
Sure I can do that. Where can I get the Windows binaries for that version? |
Please build Windows binaries from the Net-SNMP source code. Instructions are available in https://github.com/net-snmp/net-snmp/blob/master/README.win32. The build status is available at https://ci.appveyor.com/project/BVanAssche87257/net-snmp/history. |
I'm attempting to build on a Windows 7 - 64bit system and following the readme for ' Microsoft Visual Studio - Configure / nmake - Building'.
Here is the make.out file.
What am I missing? |
That message may indicate a bug. If the following helps, I will prepare a proper patch:
|
Removing that line allowed me to complete the build. |
Compiling from the source from this repo I have: Using:
How do we proceed from here? |
Please retest with the latest version of the master branch. Multiple changes have been checked in, including the following change: 6024a9e |
When running win32/build.bat the numeric toggle options are offset by one. If I wish to toggle 'install after build' is have to select 6, to enable IPv6 I have to select 11. I think this is because the SDK option was removed. |
That's correct, the SDK option has been removed by the following commit: bbbf866. Is the renumbering of the options causing any issues? |
Yes it would seem so. Now to toggle an option you need to use the displayed number +1. |
I built using master ec3cf02.
|
This patch changes the minimum requirement for snmpd.exe built with MSVC to Windows 8.1 / Windows Server 2003. See also https://docs.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo. See also net-snmp#304.
This patch changes the minimum requirement for snmpd.exe built with MSVC to Windows 8.1 / Windows Server 2003. See also https://docs.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo. See also net-snmp#304 .
Please retest with the latest version of the master branch. Fixes for build.bat and also for IPv6 have been checked in. |
I built from 9e5370d , just noticed that snmpstatus doesn't exist. |
Sorry my mistake. I was in the wrong directory ... I built from 9e5370d but it still doesn't work.
I'm building on Win7 and testing on Server 2008, could that be an issue? Also, even testing against localhost doesn't resolve the IPv6 address. |
Building on Windows 7 and testing on Windows Server 2008 should be fine. I see
Please double check that commit 18ff188 is present in your local copy of the Net-SNMP git repository. |
Just noticed that netsnmp_getaddrinfo() is present in the above output so we are making progress :-) Is an IPv6 address associated with the host name |
It's a private network with its own DNS. You can see the result of the DNS lookup in my first post where I ping the hostname which resolves to an IPv6 address. |
I think that the following output shows that getaddrinfo() has not been called:
However, it should have been called. The "failed to parse" message shows that netsnmp_resolve_v6_hostname() has been called. netsnmp_resolve_v6_hostname() calls netsnmp_getaddrinfo() if the HAVE_GETADDRINFO has been defined and has a numerical value != 0. |
Are you expecting line Line 979 in 67b5906
Do you need me to do another test? |
I think that it's hitting this lookup function.
and we are not seeing this message
|
If both getaddrinfo() and gethostbyname() are available, getaddrinfo() should be called. The screenshot shows that HAVE_GETADDRINFO == 1 but the logs show that gethostbyname() is called. I'm not sure what's going on. |
I don't know if this provides any additional info or not, built from commit bd292ce.
|
This patch changes the minimum requirement for snmpd.exe built with MSVC to Windows 8.1 / Windows Server 2003. See also https://docs.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo. See also net-snmp#304 .
The above output shows again that netsnmp_resolve_v6_hostname() calls netsnmp_gethostbyname() instead of netsnmp_getaddrinfo(). Would it be possible to run snmpstatus inside a debugger and analyze why this happens? |
If I build the master branch myself on Windows with MSVC or MinGW64, the following output appears:
As one can see, getaddrinfo() is called. |
I'd be willing to try, although I will need some assistance setting that up and guidance on the debugging steps. Over the past few days I installed the MSYS2/Mingw-w64 software and created a build with it. I had some problems while running ./configure, it consumed all my system memory when configuring. I had to power cycle my computer after the configuration step as the system would not restart normally. I was able to repeat this on two systems, two times each. Both systems are Win7 64-bit. After running configure, power cycling and the running make, the result is no different. This output is from my build using i686-w64-mingw32.
Would you expect different results if I were to compile for x86_64-w64-mingw32? |
Success !
The result was a x64 build that works.
Next I'd like to build with link = dynamic and with the other modules enabled to replace the current 5.7 x86 version I have installed. |
That's great news! Thanks for the update. |
This patch changes the minimum requirement for snmpd.exe built with MSVC to Windows XP / Windows Server 2003. See also https://docs.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo . See also net-snmp#304 .
I'm using net-snmp on Windows Server 2008 R2 and I can not get net-snmp utilities to work when the DNS response for a hostname is an IPv6 address.
To confirm DNS I can ping, for example:
If I try using the hostname in the snmp command I get a "Unknown host" response. These are the command variations I've tried:
As you can see the use of the IPv6 address directly works as expected.
If I add -DALL I can see attempts to resolve the name but they appear to be IPv4 related unless I use the form udp6:myipv6host.mycompany.com.
This seems to apply to any pre-compiled binary I've found for net-snmp version 5.5+.
Running net-snmp commands on a CentOS7 installation works as expected with or without the udp6: qualifier in front of the hostname.
Any help resolving this would be greatly appreciated.
Thanks
The text was updated successfully, but these errors were encountered: