[cups.bugs] [LOW] STR #3464: cupsd resolves localhost to both IPv4 and IPv6 address even if only 1 is set

Ecki ecki at intershop.de
Tue Jan 5 14:05:20 PST 2010


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

I only have an IPv4 entry for localhost (Only IPv4 is in use, but IPv6 is
activated for possible network diagnosis. Usually I have some more entry
like "::1 me-ipv6", but even this is not the case here) in /etc/hosts and
the only (network related) "Listen" entry "Listen localhost:631" in
cupsd.conf.

When starting cupsd (tested for both versions: 1.3.11 and 1.4.2), I have
two listening network sockets: 127.0.0.1:631 and ::1:631.

In cups source file http-addrlist.c, I find the following comment in the
source of httpAddrGetList():

     /*
      * Unfortunately, some users ignore all of the warnings in the
      * /etc/hosts file and delete "localhost" from it. If we get here
      * then we were unable to resolve the name, so use the IPv6 and/or
      * IPv4 loopback interface addresses...
      */

This behaviour is incorrect (yet not deeply analyzed).

If one _has_ an entry with a hostname in cupsd.conf, this hostname has to
be resolved correctly (or an error should be thrown if localhost can't be
resolved), even if the hostname is "localhost". If no entry with a
hostname is given (only port), this _may_ be the default behaviour (or
listening on all configured interfaces with the given port, or something
else).

However, changing to "Listen 127.0.0.1:631" works fine.

As noted above, this seem to be the case for both 1.3.* and 1.4.*, even if
I didn't check all versions...

Link: http://www.cups.org/str.php?L3464
Version: 1.3.11





More information about the cups-devel mailing list