New issue
Advanced search Search tips

Issue 838677 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Today
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Cannot change Printer URI from Link Local to Static IP

Project Member Reported by skau@chromium.org, May 1 2018

Issue description

Chrome Version: 68.0.3416.0
OS: CrOS

What steps will reproduce the problem?
(1) Add a "nearby" printer
(2) Edit said printer
(3) Change URI from a *.local" address to an IP address
(4) Try to save

What is the expected result?
Printer record saves after confirming connectivity to the printer

What happens instead?
Saving printer fails
 
After digging into the code, I've determined that the reason for this bug is because the function Printer::RequiresIpResolution() is returning true, even when we no longer have an mDNS hostname that must be resolved.

This function returns true when the effective_uri of the printer is empty, and the id of the printer begins with "zeroconf-".

Of course the id begins with "zeroconf-" because we are editing an existing zeroconf printer. So we'll either have to make some changes to "effective_uri_" in HandleAddCupsPrinter() or rethink the way the function RequiresIpResolution() works.
In hindsight, using zeroconf- for RequiresIpResolution() was a poor choice.  We should look into storing a bit in the Printer object or checking if the url is a *.local address. 

We may need to perform proper dns lookup :/ which would require consulting the host resolver[1] first then performing the mDNS resolution.

[1]https://cs.chromium.org/chromium/src/net/dns/host_resolver.h?q=SingleRequestHostResolver&sq=package:chromium&dr=C&l=41
Labels: -M-68 M-71
Status: Started (was: Assigned)
Cc: weifangsun@chromium.org
Labels: -M-71 M-72
Ping - What's the status of this one?
Labels: -M-72 M-73
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dd614e746cbe135dae4407ba85f68dc1b295b574

commit dd614e746cbe135dae4407ba85f68dc1b295b574
Author: David Valleau <valleau@chromium.org>
Date: Fri Jan 11 19:25:30 2019

Fixing bugs for editing configured zeroconf printer

This change fixes the bug where if a user attempts to change the URI of
an existing configured zeroconf printer from a link local address to a
static IP address the attempt to add the device would timeout and fail.

This issue was caused by wrongly attempting to perform domain name resolution on
the IP address instead of simply performing the configuration with the
new address.

Bug:  838677 
Change-Id: Iba1a8fb8dfd0194138e2d0aa881592027fd713bd
Reviewed-on: https://chromium-review.googlesource.com/c/1109387
Commit-Queue: David Valleau <valleau@chromium.org>
Reviewed-by: Sean Kau <skau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622091}
[modify] https://crrev.com/dd614e746cbe135dae4407ba85f68dc1b295b574/chrome/browser/chromeos/printing/printer_configurer.cc
[modify] https://crrev.com/dd614e746cbe135dae4407ba85f68dc1b295b574/chromeos/printing/printer_configuration.cc
[modify] https://crrev.com/dd614e746cbe135dae4407ba85f68dc1b295b574/chromeos/printing/printer_configuration_unittest.cc

Comment 8 by weifangsun@chromium.org, Today (11 hours ago)

Status: Fixed (was: Started)

Sign in to add a comment