shill: DHCPConfig: Report Web Proxy Auto Discovery
Provide the Web Proxy Auto Discovery property displayed by the
DHCP client as a property to the ifconfig. This will allow
Chrome to discover that value.
CQ-DEPEND=CL:59990
BUG=chromium:253915
TEST=New autotest network_DhcpWpadNegotiation
https://gerrit.chromium.org/gerrit/60020
Change-Id: I79521fd5873a2e7c2b2c4107e36545819a9a077d
Reviewed-on: https://gerrit.chromium.org/gerrit/60015
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
diff --git a/dhcp_config.cc b/dhcp_config.cc
index 4742baa..bd04c1e 100644
--- a/dhcp_config.cc
+++ b/dhcp_config.cc
@@ -38,6 +38,8 @@
const char DHCPConfig::kConfigurationKeyMTU[] = "InterfaceMTU";
const char DHCPConfig::kConfigurationKeyRouters[] = "Routers";
const char DHCPConfig::kConfigurationKeySubnetCIDR[] = "SubnetCIDR";
+const char DHCPConfig::kConfigurationKeyWebProxyAutoDiscoveryUrl[] =
+ "WebProxyAutoDiscoveryUrl";
const int DHCPConfig::kDHCPCDExitPollMilliseconds = 50;
const int DHCPConfig::kDHCPCDExitWaitMilliseconds = 3000;
const char DHCPConfig::kDHCPCDPath[] = "/sbin/dhcpcd";
@@ -415,6 +417,8 @@
}
} else if (key == kConfigurationKeyClasslessStaticRoutes) {
classless_static_routes = value.reader().get_string();
+ } else if (key == kConfigurationKeyWebProxyAutoDiscoveryUrl) {
+ properties->web_proxy_auto_discovery = value.reader().get_string();
} else {
SLOG(DHCP, 2) << "Key ignored.";
}
diff --git a/dhcp_config.h b/dhcp_config.h
index fdd71f9..60e9a03 100644
--- a/dhcp_config.h
+++ b/dhcp_config.h
@@ -105,6 +105,7 @@
static const char kConfigurationKeyMTU[];
static const char kConfigurationKeyRouters[];
static const char kConfigurationKeySubnetCIDR[];
+ static const char kConfigurationKeyWebProxyAutoDiscoveryUrl[];
static const int kDHCPCDExitPollMilliseconds;
static const int kDHCPCDExitWaitMilliseconds;
diff --git a/ipconfig.cc b/ipconfig.cc
index 8fb2214..5eec6de 100644
--- a/ipconfig.cc
+++ b/ipconfig.cc
@@ -60,8 +60,10 @@
&properties_.peer_address);
store_.RegisterConstInt32(flimflam::kPrefixlenProperty,
&properties_.subnet_prefix);
- store_.RegisterConstStrings(shill::kSearchDomainsProperty,
+ store_.RegisterConstStrings(kSearchDomainsProperty,
&properties_.domain_search);
+ store_.RegisterConstString(kWebProxyAutoDiscoveryUrlProperty,
+ &properties_.web_proxy_auto_discovery);
SLOG(Inet, 2) << __func__ << " device: " << device_name();
}
diff --git a/ipconfig.h b/ipconfig.h
index 96d07b3..fa2d0a0 100644
--- a/ipconfig.h
+++ b/ipconfig.h
@@ -58,6 +58,8 @@
bool blackhole_ipv6;
int32 mtu;
std::vector<Route> routes;
+ // Web Proxy Auto Discovery (WPAD) URL gained from DHCP.
+ std::string web_proxy_auto_discovery;
};
enum ReleaseReason {