Package: python-dns
Version: 2.3.1-6
Severity: normal
Tags: patch

Running python-dns on a system that has a "nameserver" entry with an IPv6
address in resolv.conf causes an

    "Address family for hostname not supported"

error because the IPv6 address cannot be turned into an IPv4 atom.

Since python-dns currently does not support querying IPv6 nameservers
anyway, it should just ignore any IPv6 "nameserver" entries.

Patch attached.
diff -ruN python-dns-2.3.1.org/debian/changelog python-dns-2.3.1/debian/changelog
--- python-dns-2.3.1.org/debian/changelog	2008-07-30 13:55:26.000000000 +0000
+++ python-dns-2.3.1/debian/changelog	2008-07-30 14:23:43.000000000 +0000
@@ -1,3 +1,10 @@
+python-dns (2.3.1-6+ipv6safe) UNRELEASED; urgency=low
+
+  * Safely ignore "nameserver" entries in resolv.conf that list IPv6 resolvers,
+    as querying those is not currently supported.
+
+ -- Julian Mehnle <[EMAIL PROTECTED]>  Wed, 30 Jul 2008 14:16:29 +0000
+
 python-dns (2.3.1-6) unstable; urgency=high
 
   * Fix debian/patches/source-tid-random.patch so it doesn't lose socket
diff -ruN python-dns-2.3.1.org/DNS/Base.py python-dns-2.3.1/DNS/Base.py
--- python-dns-2.3.1.org/DNS/Base.py	2008-07-30 13:55:26.000000000 +0000
+++ python-dns-2.3.1/DNS/Base.py	2008-07-30 14:11:12.000000000 +0000
@@ -40,7 +40,11 @@
         if fields[0]=='sortlist':
             pass
         if fields[0]=='nameserver':
-            defaults['server'].append(fields[1])
+            if fields[1].count(':'):
+                """ Ignore IPv6 nameservers as we currently do not support querying them. """
+                pass
+            else:
+                defaults['server'].append(fields[1])
 
 def DiscoverNameServers():
     import sys

Reply via email to