mbox series

[00/15] Improve PAC URL Mutation and PAC URL and WISPr Proxy Failure Logging

Message ID 20241212052817.2021264-1-gerickson@nuovations.com (mailing list archive)
Headers show
Series Improve PAC URL Mutation and PAC URL and WISPr Proxy Failure Logging | expand

Message

Grant Erickson Dec. 12, 2024, 5:28 a.m. UTC
There appear to be a population of premises ISP equipment (some
possibly correlated with Spectrum Communications in Southern
California, United States) in which the ISP equipment sporadically and
incorrectly emits DHCP Option 252 ("Web Proxy Auto-Discovery (WPAD)")
with an invalid proxy auto-configuration (PAC) URL (such as
'http://wpad.lan/wpad.dat'), even when neither the customer nor the
ISP has such an option actively configured on the equipment.

This URL, per the WPAD specification, leads the Connection Manager to
believe that it must use a proxy to reach HTTP- or HTTPS-based
resources, including those specified for WISPr online reachability
checks. Because neither the PAC file ('wpad.dat' in the example above)
nor the host ('wpad.lan' in the example above) associated with the PAC
URL exist, those online reachability checks unconditionally fail
despite such resources being directly reachable, without an
intervening proxy.

Because:

  * PAC configuration (or lack thereof) has not been historically
  * POSIX error codes are themselves limited (for example, there are
    no -ENOPROXY, -EBADPROXY, or -EPROXYLOOKUP codes)
  * POSIX error code usage for WISPr failures is similarly limited
    (for example, -EINVAL)

insight into the actual nature of an online reachability check failure
is, by extension, limited, particularly when proxy failures are
involved. Consequently, log messages generated from these changes
provide crucial insight into triaging and resolving such failures.

Finally, there have been three (3) call sites in the network service
code where the network service proxy auto-configuration (PAC) URL was
set. However, it was never (but now, with these changes, is) set in
'__connman_service_set_proxy_autoconfig', where it is invoked by the
DHCP client code when DHCP option 252 (Web Proxy Auto-Discovery
(WPAD)) is encountered.

Grant Erickson (15):
  service: Add 'service_log_pac' function.
  service: Add 'service_set_pac' function.
  service: Leverage 'service_set_pac' function.
  service: Ensure the PAC URL is set in
    '__connman_service_set_proxy_autoconfig'.
  service: Document 'service_log_pac'.
  service: Document 'service_set_pac'.
  service: Add 'service_set_proxy_method' function.
  service: Leverage 'service_set_proxy_method'.
  service: Leverage 'service_set_proxy_method'.
  service: Document 'service_set_proxy_method'.
  service: Document 'service_set_proxy_method_auto_handler'.
  service: Document '__connman_service_set_proxy_autoconfig'.
  wispr: Add 'wispr_log_proxy_failure' function.
  wispr: Leverage 'wispr_log_proxy_failure'.
  wispr: Document 'wispr_log_proxy_failure'.

 src/service.c | 273 +++++++++++++++++++++++++++++++++++++++++++-------
 src/wispr.c   |  42 +++++++-
 2 files changed, 276 insertions(+), 39 deletions(-)