[Pkg-utopia-maintainers] Bug#898038: avahi-daemon-check-dns.sh hangs forever if a nameserver has ::1 in the address

Andrej Shadura andrewsh at debian.org
Sun May 6 08:27:30 BST 2018


Package: avahi-daemon
Version: 0.7-4
Severity: important

Dear Maintainer,

There seems to be an error in the regex used to detect the presence of
the local nameservers:

    egrep -q "nameserver 127.0.0.1|::1" /etc/resolv.conf

This also happily greps things like:

    ::1
    nameserver 2001:1234:5678::10
    ::1234
    wrong::1

etc.

This patch may fix the issue, but I haven't checked its correctness, only
ran a short test:

diff --git a/debian/avahi-daemon-check-dns.sh b/debian/avahi-daemon-check-dns.sh
index 7f92e9d..23e5f06 100755
--- a/debian/avahi-daemon-check-dns.sh
+++ b/debian/avahi-daemon-check-dns.sh
@@ -43,7 +43,7 @@ dns_reachable() {
 
   # If there is no local nameserver and no we have no global ip addresses
   # then we can't reach any nameservers
-  if ! $(egrep -q "nameserver 127.0.0.1|::1" /etc/resolv.conf); then 
+  if ! $(egrep -q "nameserver (127.0.0.1|::1)" /etc/resolv.conf); then 
     if [ -x "$(which ip)" ]; then
       ADDRS=$(ip addr show scope global | grep inet)
       ROUTES=$(ip route show 0.0.0.0/0)

-- 
Cheers,
  Andrej



More information about the Pkg-utopia-maintainers mailing list