Skip to content

Commit

Permalink
If we mirror our printer to a port of localhost, advertise its web in…
Browse files Browse the repository at this point in the history
…terface

If we mirror our USB printer to a port on localhost (loopback
interface), we can easily DNS-SD-advertise the web admin interface of
the printer as "http://localhost:PORT/", whereas using other
interfaces causes problems with the host name.

Therefore we add the "adminurl" field to the TXT record of our DNS-SD
advertising only if we have mirrored the printer to the loopback
interface.
  • Loading branch information
tillkamppeter committed Apr 26, 2017
1 parent 50f0129 commit 483a966
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dnssd.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ dnssd_register(AvahiClient *c)
ipp_txt = NULL;
ipp_txt = avahi_string_list_add_printf(ipp_txt, "rp=ipp/print");
ipp_txt = avahi_string_list_add_printf(ipp_txt, "ty=%s %s", make, model);
/* ipp_txt = avahi_string_list_add_printf(ipp_txt, "adminurl=%s", temp); */
if (strcasecmp(g_options.interface, "lo") == 0)
ipp_txt = avahi_string_list_add_printf(ipp_txt, "adminurl=%s", temp);
ipp_txt = avahi_string_list_add_printf(ipp_txt, "product=(%s)", model);
ipp_txt = avahi_string_list_add_printf(ipp_txt, "pdl=%s", formats);
ipp_txt = avahi_string_list_add_printf(ipp_txt, "Color=U");
Expand Down

0 comments on commit 483a966

Please sign in to comment.