Bug 247723 - print/hplip: Fix mdns support
Summary: print/hplip: Fix mdns support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Ben Woods
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2020-07-02 19:46 UTC by Tijl Coosemans
Modified: 2020-07-21 19:12 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (woodsb02)
koobs: merge-quarterly?


Attachments
patch (3.39 KB, patch)
2020-07-02 19:46 UTC, Tijl Coosemans
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tijl Coosemans freebsd_committer freebsd_triage 2020-07-02 19:46:15 UTC
Created attachment 216151 [details]
patch

files/patch-protocol_discovery_mdns.c adds SO_REUSEPORT to fix mDNS support when Avahi is running.  This used to work but at least on FreeBSD head this is no longer the case.  It seems that port reuse is only allowed for processes from the same user now.  But even if Avahi is not running and port 5353 is available my printer still fails to be detected.  According to RFC 6762 only fully compliant queriers should be using that port which HPLIP isn't.  I suspect the printer is sending responses that HPLIP can't parse.  The attached patch changes files/patch-protocol_discovery_mdns.c so HPLIP uses a standard socket which is enough for one-shot queries.  With this patch the printer is detected by "hp-probe --method=mdns" and xsane can find the scanner part of the printer using the hpaio plugin.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2020-07-03 01:59:24 UTC
^Triage: [tags] in issue Titles are deprecated
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2020-07-03 02:00:06 UTC
Comment on attachment 216151 [details]
patch

Run-time bugfixes are:

Approved by: portmgr (blanket: run-time bugfix)
MFH: <branch> (blanket: run-time bugfix)
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-07-21 19:01:28 UTC
A commit references this bug:

Author: tijl
Date: Tue Jul 21 19:00:40 UTC 2020
New revision: 542780
URL: https://svnweb.freebsd.org/changeset/ports/542780

Log:
  Fix mDNS support for network printers.

  At least on FreeBSD 13, SO_REUSEPORT is no longer sufficient when Avahi
  already uses port 5353.  It seems that port reuse is only allowed for
  processes from the same user now.  But even if Avahi is not running and
  port 5353 is available my printer still failed to be detected.  According
  to RFC 6762 only fully compliant queriers should be using that port which
  HPLIP isn't.  I suspect the printer is sending responses that HPLIP can't
  parse.  Patch HPLIP to use a simple socket (dynamically allocated port)
  which is enough for the one-shot mDNS queries it performs.

  Now my printer is detected by "hp-probe --method=mdns" and xsane can find
  the scanner part using the hpaio plugin.

  PR:		247723
  Approved by:	maintainer timeout (19 days)

Changes:
  head/print/hplip/Makefile
  head/print/hplip/files/patch-protocol_discovery_mdns.c