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.
^Triage: [tags] in issue Titles are deprecated
Comment on attachment 216151 [details] patch Run-time bugfixes are: Approved by: portmgr (blanket: run-time bugfix) MFH: <branch> (blanket: run-time bugfix)
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