Skip to content

Commit 7506f0c

Browse files
yetamrraChromium LUCI CQ
authored andcommitted
Don't treat zeroconf lpd records with port 0 as errors
The Bonjour spec requires printers to register their names with _printer records even if they don't support LPD. They indicate the lack of support by registering a record with a port of 0. Since this is an expected event for this scenario, don't log it as an error. Bug: None Test: Watch chrome://device-log with local printer mDNS traffic Change-Id: I15590c589c6e5ae44789b1353b638d247f9cce9e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5925508 Commit-Queue: Benjamin Gordon <[email protected]> Reviewed-by: Nathan Muggli <[email protected]> Cr-Commit-Position: refs/heads/main@{#1367812}
1 parent 90ccf3c commit 7506f0c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

chrome/browser/ash/printing/zeroconf_printer_detector.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,15 @@ bool ConvertToPrinter(const std::string& service_type,
181181
return false;
182182
}
183183
if (service_description.address.port() == 0) {
184-
PRINTER_LOG(ERROR) << "Found zeroconf " << service_type
185-
<< " printer named '" << service_description.service_name
186-
<< "' with invalid port.";
184+
// Bonjour printers are required to register the _printer._tcp name even if
185+
// they don't support LPD. If they don't support LPD, they use a port of 0
186+
// to indicate this, so it is not an error.
187+
if (service_type != ZeroconfPrinterDetector::kLpdServiceName) {
188+
PRINTER_LOG(ERROR) << "Found zeroconf " << service_type
189+
<< " printer named '"
190+
<< service_description.service_name
191+
<< "' with invalid port.";
192+
}
187193
return false;
188194
}
189195

0 commit comments

Comments
 (0)