Menu

#2427 Utils cannot resolve IPv6-only hostnames

IPv6
closed
5
2013-06-12
2012-12-16
No

NET-SNMP version: 5.5
Scientific Linux 6.3

Not sure if this is really a bug or just an IPv4-centric 'feature'. When specifying a hostname that only resolves to an IPv6 address to the various utils such as snmpwalk, the util complains that getaddrinfo cannot resolve the hostname and aborts.

[tony@sol ~]$ snmpwalk bunker003.manaikaika.com
No log handling enabled - turning on stderr logging
getaddrinfo: bunker003.manaikaika.com Name or service not known
snmpwalk: Unknown host (bunker003.manaikaika.com)

Of course this works if udp6: is explicitly added as a prefix to the hostname. However, in the absense of an explicit protocol shouldn't the above just work for IPv6-only hosts?

1 Attachments

Discussion

  • Niels Baggesen

    Niels Baggesen - 2013-02-09
    • status: open --> accepted
    • assigned_to: Niels Baggesen
     
  • Niels Baggesen

    Niels Baggesen - 2013-02-09

    Yes, that does not look right ... luckily not many systems are IPv6 only :-)

    The attached patch hopefully fixes that

    /Niels

     
  • Bill Fenner

    Bill Fenner - 2013-02-12

    Is it a good idea to "#if 0" error logging altogether? What if the error returned when trying the first transport is the one you actually want to have logged?

     
  • Niels Baggesen

    Niels Baggesen - 2013-02-12

    Well, my first thought was, that this deep down library routine should certainly not log anything by itself.
    Second, I cannot immediately see any significant difference between the error from the first getaddrinfo call, and the second?
    Can you come up with an example where it makes a difference? I am all open, this was just a first hack to solve the original problem!

     
  • Antonio Querubin

    On Sat, 9 Feb 2013, Niels Baggesen wrote:

    Yes, that does not look right ... luckily not many systems are IPv6 only :-)

    The attached patch hopefully fixes that

    Works. Thanks!

    Antonio Querubin
    e-mail: tony@lavanauts.org
    xmpp: antonioquerubin@gmail.com

     
  • Niels Baggesen

    Niels Baggesen - 2013-06-12
    • status: accepted --> closed
     
  • Niels Baggesen

    Niels Baggesen - 2013-06-12

    The problem has now been fixed in the V 5.7 and trunk branches.

     

Log in to post a comment.