[cups.bugs] [MOD] STR #3737: cannot get cups to send IP address in printer URIs

Jon Peatfield jp107 at cam.ac.uk
Thu Dec 2 13:39:10 PST 2010


[STR New]

I was an idiot earlier and tried replying to the mail message that the STR
generated.  Sorry for any noise that caused.

Anywat this is my message:

At least in earlier versions of cups, the cups/ipp adverts contain the
name/address that cups determines is correct for the interface that the
advert is being sent _from_ and isn't related to ServerName at all.

ie for cups-1.3.7 (I happen to have that source at hand) in
scheduler/dirsvc.c is the function send_cups_browse() which contains:

   for (i = NumBrowsers, b = Browsers; i > 0; i --, b ++)
     if (b->iface[0])
       * Send the browse packet to one or more interfaces...
        for (iface = (cupsd_netif_t *)cupsArrayFirst(NetIFList);
             iface = (cupsd_netif_t *)cupsArrayNext(NetIFList))
          httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp",
                           iface->hostname, iface->port,
                           (p->type & CUPS_PRINTER_CLASS) ? "/classes/%s"

so the name/address used is unrelated to what ServerName is set to - it
will be looking up the name of the address that it thinks is associated
with the interface...

Depending on your setup you may be able to get what you want by one or
more of:

   getting cups to only *listen* on the address that the adverts
   should include a reference to

   changing browseaddress to not include interfaces which arn't the ones
   you want

   use browserelay to send to a specific address/network

In one of our bits of network we have a cups server on a gateway between a
network with the 'real cups servers' and the client machines.  There is a
firewall so the clients wouldn't see adverts from the real servers, so we
added a cups server on the gateway which uses browsepoll to the real
servers to obtain a list and browserelay to forward the cups adverts that
cups-polld sends to cupsd on to the client networks...  It is ugly but it
does work...

If this helps you then great, if not I may not have explained myself very
clearly; or I may have misunderstood what you are trying to do.

None of this should be assumed to be true without checking with either an
expert or the current cups source (or both).

Link: http://www.cups.org/str.php?L3737
Version: 1.4.4

More information about the cups-devel mailing list