Darin Petkov | 50308cd | 2011-06-01 18:25:07 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "shill/dhcp_config.h" |
| 6 | |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 7 | #include <arpa/inet.h> |
| 8 | |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 9 | #include <base/file_util.h> |
Darin Petkov | 50308cd | 2011-06-01 18:25:07 -0700 | [diff] [blame] | 10 | #include <base/logging.h> |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 11 | #include <base/stringprintf.h> |
Chris Masone | 43b48a1 | 2011-07-01 13:37:07 -0700 | [diff] [blame] | 12 | #include <chromeos/dbus/service_constants.h> |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 13 | |
| 14 | #include "shill/dhcpcd_proxy.h" |
| 15 | #include "shill/dhcp_provider.h" |
Paul Stewart | 26b327e | 2011-10-19 11:38:09 -0700 | [diff] [blame] | 16 | #include "shill/event_dispatcher.h" |
Darin Petkov | 3258a81 | 2011-06-23 11:28:45 -0700 | [diff] [blame] | 17 | #include "shill/glib.h" |
Paul Stewart | 1d18e8c | 2011-07-15 11:00:31 -0700 | [diff] [blame] | 18 | #include "shill/ip_address.h" |
Darin Petkov | aceede3 | 2011-07-18 15:32:38 -0700 | [diff] [blame] | 19 | #include "shill/proxy_factory.h" |
Darin Petkov | 50308cd | 2011-06-01 18:25:07 -0700 | [diff] [blame] | 20 | |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 21 | using std::string; |
| 22 | using std::vector; |
| 23 | |
Darin Petkov | 50308cd | 2011-06-01 18:25:07 -0700 | [diff] [blame] | 24 | namespace shill { |
| 25 | |
Chris Masone | 0756f23 | 2011-07-21 17:24:00 -0700 | [diff] [blame] | 26 | // static |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 27 | const char DHCPConfig::kConfigurationKeyBroadcastAddress[] = "BroadcastAddress"; |
| 28 | const char DHCPConfig::kConfigurationKeyDNS[] = "DomainNameServers"; |
| 29 | const char DHCPConfig::kConfigurationKeyDomainName[] = "DomainName"; |
| 30 | const char DHCPConfig::kConfigurationKeyDomainSearch[] = "DomainSearch"; |
| 31 | const char DHCPConfig::kConfigurationKeyIPAddress[] = "IPAddress"; |
| 32 | const char DHCPConfig::kConfigurationKeyMTU[] = "InterfaceMTU"; |
| 33 | const char DHCPConfig::kConfigurationKeyRouters[] = "Routers"; |
| 34 | const char DHCPConfig::kConfigurationKeySubnetCIDR[] = "SubnetCIDR"; |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 35 | const char DHCPConfig::kDHCPCDPath[] = "/sbin/dhcpcd"; |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 36 | const char DHCPConfig::kDHCPCDPathFormatLease[] = "var/run/dhcpcd-%s.lease"; |
| 37 | const char DHCPConfig::kDHCPCDPathFormatPID[] = "var/run/dhcpcd-%s.pid"; |
Darin Petkov | f9b0ca8 | 2011-06-20 12:10:23 -0700 | [diff] [blame] | 38 | const char DHCPConfig::kReasonBound[] = "BOUND"; |
| 39 | const char DHCPConfig::kReasonFail[] = "FAIL"; |
| 40 | const char DHCPConfig::kReasonRebind[] = "REBIND"; |
| 41 | const char DHCPConfig::kReasonReboot[] = "REBOOT"; |
| 42 | const char DHCPConfig::kReasonRenew[] = "RENEW"; |
Chris Masone | 0756f23 | 2011-07-21 17:24:00 -0700 | [diff] [blame] | 43 | // static |
| 44 | const char DHCPConfig::kType[] = "dhcp"; |
Darin Petkov | f9b0ca8 | 2011-06-20 12:10:23 -0700 | [diff] [blame] | 45 | |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 46 | |
Chris Masone | 19e3040 | 2011-07-19 15:48:47 -0700 | [diff] [blame] | 47 | DHCPConfig::DHCPConfig(ControlInterface *control_interface, |
Darin Petkov | a7b8949 | 2011-07-27 12:48:17 -0700 | [diff] [blame] | 48 | EventDispatcher *dispatcher, |
Chris Masone | 19e3040 | 2011-07-19 15:48:47 -0700 | [diff] [blame] | 49 | DHCPProvider *provider, |
Darin Petkov | f65e928 | 2011-06-21 14:29:56 -0700 | [diff] [blame] | 50 | const string &device_name, |
Darin Petkov | 3258a81 | 2011-06-23 11:28:45 -0700 | [diff] [blame] | 51 | GLib *glib) |
Chris Masone | 0756f23 | 2011-07-21 17:24:00 -0700 | [diff] [blame] | 52 | : IPConfig(control_interface, device_name, kType), |
Darin Petkov | ab565bb | 2011-10-06 02:55:51 -0700 | [diff] [blame] | 53 | proxy_factory_(ProxyFactory::GetInstance()), |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 54 | provider_(provider), |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 55 | pid_(0), |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 56 | child_watch_tag_(0), |
| 57 | root_("/"), |
Darin Petkov | a7b8949 | 2011-07-27 12:48:17 -0700 | [diff] [blame] | 58 | task_factory_(this), |
| 59 | dispatcher_(dispatcher), |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 60 | glib_(glib) { |
mukesh agrawal | de29fa8 | 2011-09-16 16:16:36 -0700 | [diff] [blame] | 61 | mutable_store()->RegisterConstString(flimflam::kAddressProperty, |
| 62 | &(properties().address)); |
Darin Petkov | f65e928 | 2011-06-21 14:29:56 -0700 | [diff] [blame] | 63 | VLOG(2) << __func__ << ": " << device_name; |
Darin Petkov | 50308cd | 2011-06-01 18:25:07 -0700 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | DHCPConfig::~DHCPConfig() { |
Darin Petkov | f65e928 | 2011-06-21 14:29:56 -0700 | [diff] [blame] | 67 | VLOG(2) << __func__ << ": " << device_name(); |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 68 | |
| 69 | // Don't leave behind dhcpcd running. |
| 70 | Stop(); |
| 71 | |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 72 | // Make sure we don't get any callbacks to the destroyed instance. |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 73 | CleanupClientState(); |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 74 | } |
| 75 | |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 76 | bool DHCPConfig::RequestIP() { |
Darin Petkov | f65e928 | 2011-06-21 14:29:56 -0700 | [diff] [blame] | 77 | VLOG(2) << __func__ << ": " << device_name(); |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 78 | if (!pid_) { |
| 79 | return Start(); |
| 80 | } |
| 81 | if (!proxy_.get()) { |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 82 | LOG(ERROR) << "Unable to request IP before acquiring destination."; |
| 83 | return Restart(); |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 84 | } |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 85 | return RenewIP(); |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 86 | } |
| 87 | |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 88 | bool DHCPConfig::RenewIP() { |
Darin Petkov | f65e928 | 2011-06-21 14:29:56 -0700 | [diff] [blame] | 89 | VLOG(2) << __func__ << ": " << device_name(); |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 90 | if (!pid_) { |
| 91 | return false; |
| 92 | } |
Darin Petkov | aceede3 | 2011-07-18 15:32:38 -0700 | [diff] [blame] | 93 | proxy_->Rebind(device_name()); |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 94 | return true; |
| 95 | } |
| 96 | |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 97 | bool DHCPConfig::ReleaseIP() { |
Darin Petkov | f65e928 | 2011-06-21 14:29:56 -0700 | [diff] [blame] | 98 | VLOG(2) << __func__ << ": " << device_name(); |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 99 | if (!pid_) { |
| 100 | return true; |
| 101 | } |
Darin Petkov | a7b8949 | 2011-07-27 12:48:17 -0700 | [diff] [blame] | 102 | if (proxy_.get()) { |
| 103 | proxy_->Release(device_name()); |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 104 | } |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 105 | Stop(); |
| 106 | return true; |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 107 | } |
| 108 | |
Darin Petkov | a7b8949 | 2011-07-27 12:48:17 -0700 | [diff] [blame] | 109 | void DHCPConfig::InitProxy(const string &service) { |
| 110 | // Defer proxy creation because dbus-c++ doesn't allow registration of new |
| 111 | // D-Bus objects in the context of a D-Bus signal handler. |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 112 | if (!proxy_.get()) { |
Darin Petkov | a7b8949 | 2011-07-27 12:48:17 -0700 | [diff] [blame] | 113 | dispatcher_->PostTask( |
| 114 | task_factory_.NewRunnableMethod(&DHCPConfig::InitProxyTask, service)); |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | void DHCPConfig::InitProxyTask(const string &service) { |
| 119 | if (!proxy_.get()) { |
| 120 | VLOG(2) << "Init DHCP Proxy: " << device_name() << " at " << service; |
Darin Petkov | ab565bb | 2011-10-06 02:55:51 -0700 | [diff] [blame] | 121 | proxy_.reset(proxy_factory_->CreateDHCPProxy(service)); |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 122 | } |
| 123 | } |
| 124 | |
Darin Petkov | f9b0ca8 | 2011-06-20 12:10:23 -0700 | [diff] [blame] | 125 | void DHCPConfig::ProcessEventSignal(const string &reason, |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 126 | const Configuration &configuration) { |
| 127 | LOG(INFO) << "Event reason: " << reason; |
Darin Petkov | f9b0ca8 | 2011-06-20 12:10:23 -0700 | [diff] [blame] | 128 | if (reason == kReasonFail) { |
| 129 | LOG(ERROR) << "Received failure event from DHCP client."; |
| 130 | UpdateProperties(IPConfig::Properties(), false); |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 131 | return; |
| 132 | } |
Darin Petkov | f9b0ca8 | 2011-06-20 12:10:23 -0700 | [diff] [blame] | 133 | if (reason != kReasonBound && |
| 134 | reason != kReasonRebind && |
| 135 | reason != kReasonReboot && |
| 136 | reason != kReasonRenew) { |
| 137 | LOG(WARNING) << "Event ignored."; |
| 138 | return; |
| 139 | } |
| 140 | IPConfig::Properties properties; |
| 141 | CHECK(ParseConfiguration(configuration, &properties)); |
| 142 | UpdateProperties(properties, true); |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 143 | } |
| 144 | |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 145 | bool DHCPConfig::Start() { |
Darin Petkov | f65e928 | 2011-06-21 14:29:56 -0700 | [diff] [blame] | 146 | VLOG(2) << __func__ << ": " << device_name(); |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 147 | |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 148 | char *argv[4] = { |
| 149 | const_cast<char *>(kDHCPCDPath), |
| 150 | const_cast<char *>("-B"), // foreground |
Darin Petkov | f65e928 | 2011-06-21 14:29:56 -0700 | [diff] [blame] | 151 | const_cast<char *>(device_name().c_str()), |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 152 | NULL |
| 153 | }; |
| 154 | char *envp[1] = { NULL }; |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 155 | |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 156 | CHECK(!pid_); |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 157 | if (!glib_->SpawnAsync(NULL, |
| 158 | argv, |
| 159 | envp, |
| 160 | G_SPAWN_DO_NOT_REAP_CHILD, |
| 161 | NULL, |
| 162 | NULL, |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 163 | &pid_, |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 164 | NULL)) { |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 165 | LOG(ERROR) << "Unable to spawn " << kDHCPCDPath; |
| 166 | return false; |
| 167 | } |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 168 | LOG(INFO) << "Spawned " << kDHCPCDPath << " with pid: " << pid_; |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 169 | provider_->BindPID(pid_, this); |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 170 | CHECK(!child_watch_tag_); |
| 171 | child_watch_tag_ = glib_->ChildWatchAdd(pid_, ChildWatchCallback, this); |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame] | 172 | return true; |
Darin Petkov | 50308cd | 2011-06-01 18:25:07 -0700 | [diff] [blame] | 173 | } |
| 174 | |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 175 | void DHCPConfig::Stop() { |
| 176 | if (pid_) { |
| 177 | VLOG(2) << "Terminating " << pid_; |
| 178 | PLOG_IF(ERROR, kill(pid_, SIGTERM) < 0); |
| 179 | } |
| 180 | } |
| 181 | |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 182 | bool DHCPConfig::Restart() { |
| 183 | // Check to ensure that this instance doesn't get destroyed in the middle of |
| 184 | // this call. If stopping a running client while there's only one reference to |
| 185 | // this instance, we will end up destroying it when the PID is unbound from |
| 186 | // the Provider. Since the Provider doesn't invoke Restart, this would mean |
| 187 | // that Restart was erroneously executed through a bare reference. |
| 188 | CHECK(!pid_ || !HasOneRef()); |
| 189 | Stop(); |
| 190 | if (pid_) { |
| 191 | provider_->UnbindPID(pid_); |
| 192 | } |
| 193 | CleanupClientState(); |
| 194 | return Start(); |
| 195 | } |
| 196 | |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 197 | string DHCPConfig::GetIPv4AddressString(unsigned int address) { |
| 198 | char str[INET_ADDRSTRLEN]; |
| 199 | if (inet_ntop(AF_INET, &address, str, arraysize(str))) { |
| 200 | return str; |
| 201 | } |
| 202 | LOG(ERROR) << "Unable to convert IPv4 address to string: " << address; |
| 203 | return ""; |
| 204 | } |
| 205 | |
| 206 | bool DHCPConfig::ParseConfiguration(const Configuration& configuration, |
| 207 | IPConfig::Properties *properties) { |
| 208 | VLOG(2) << __func__; |
Chris Masone | 43b48a1 | 2011-07-01 13:37:07 -0700 | [diff] [blame] | 209 | properties->method = flimflam::kTypeDHCP; |
Paul Stewart | 7355ce1 | 2011-09-02 10:47:01 -0700 | [diff] [blame] | 210 | properties->address_family = IPAddress::kFamilyIPv4; |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 211 | for (Configuration::const_iterator it = configuration.begin(); |
| 212 | it != configuration.end(); ++it) { |
| 213 | const string &key = it->first; |
| 214 | const DBus::Variant &value = it->second; |
| 215 | VLOG(2) << "Processing key: " << key; |
| 216 | if (key == kConfigurationKeyIPAddress) { |
| 217 | properties->address = GetIPv4AddressString(value.reader().get_uint32()); |
| 218 | if (properties->address.empty()) { |
| 219 | return false; |
| 220 | } |
| 221 | } else if (key == kConfigurationKeySubnetCIDR) { |
| 222 | properties->subnet_cidr = value.reader().get_byte(); |
| 223 | } else if (key == kConfigurationKeyBroadcastAddress) { |
| 224 | properties->broadcast_address = |
| 225 | GetIPv4AddressString(value.reader().get_uint32()); |
| 226 | if (properties->broadcast_address.empty()) { |
| 227 | return false; |
| 228 | } |
| 229 | } else if (key == kConfigurationKeyRouters) { |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 230 | vector<unsigned int> routers = value.operator vector<unsigned int>(); |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 231 | if (routers.empty()) { |
| 232 | LOG(ERROR) << "No routers provided."; |
| 233 | return false; |
| 234 | } |
| 235 | properties->gateway = GetIPv4AddressString(routers[0]); |
| 236 | if (properties->gateway.empty()) { |
| 237 | return false; |
| 238 | } |
| 239 | } else if (key == kConfigurationKeyDNS) { |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 240 | vector<unsigned int> servers = value.operator vector<unsigned int>(); |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 241 | for (vector<unsigned int>::const_iterator it = servers.begin(); |
| 242 | it != servers.end(); ++it) { |
| 243 | string server = GetIPv4AddressString(*it); |
| 244 | if (server.empty()) { |
| 245 | return false; |
| 246 | } |
| 247 | properties->dns_servers.push_back(server); |
| 248 | } |
| 249 | } else if (key == kConfigurationKeyDomainName) { |
| 250 | properties->domain_name = value.reader().get_string(); |
| 251 | } else if (key == kConfigurationKeyDomainSearch) { |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 252 | properties->domain_search = value.operator vector<string>(); |
Darin Petkov | e7cb7f8 | 2011-06-03 13:21:51 -0700 | [diff] [blame] | 253 | } else if (key == kConfigurationKeyMTU) { |
| 254 | int mtu = value.reader().get_uint16(); |
| 255 | if (mtu >= 576) { |
| 256 | properties->mtu = mtu; |
| 257 | } |
| 258 | } else { |
| 259 | VLOG(2) << "Key ignored."; |
| 260 | } |
| 261 | } |
| 262 | return true; |
| 263 | } |
| 264 | |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 265 | void DHCPConfig::ChildWatchCallback(GPid pid, gint status, gpointer data) { |
| 266 | VLOG(2) << "pid " << pid << " exit status " << status; |
| 267 | DHCPConfig *config = reinterpret_cast<DHCPConfig *>(data); |
| 268 | config->child_watch_tag_ = 0; |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 269 | CHECK_EQ(pid, config->pid_); |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 270 | config->CleanupClientState(); |
| 271 | |
| 272 | // |config| instance may be destroyed after this call. |
| 273 | config->provider_->UnbindPID(pid); |
| 274 | } |
| 275 | |
| 276 | void DHCPConfig::CleanupClientState() { |
Darin Petkov | 98dd6a0 | 2011-06-10 15:12:57 -0700 | [diff] [blame] | 277 | if (child_watch_tag_) { |
| 278 | glib_->SourceRemove(child_watch_tag_); |
| 279 | child_watch_tag_ = 0; |
| 280 | } |
| 281 | if (pid_) { |
| 282 | glib_->SpawnClosePID(pid_); |
| 283 | pid_ = 0; |
| 284 | } |
Darin Petkov | f9b0ca8 | 2011-06-20 12:10:23 -0700 | [diff] [blame] | 285 | proxy_.reset(); |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 286 | file_util::Delete(root_.Append(base::StringPrintf(kDHCPCDPathFormatLease, |
Darin Petkov | f65e928 | 2011-06-21 14:29:56 -0700 | [diff] [blame] | 287 | device_name().c_str())), |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 288 | false); |
| 289 | file_util::Delete(root_.Append(base::StringPrintf(kDHCPCDPathFormatPID, |
Darin Petkov | f65e928 | 2011-06-21 14:29:56 -0700 | [diff] [blame] | 290 | device_name().c_str())), |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 291 | false); |
| 292 | } |
| 293 | |
Darin Petkov | 50308cd | 2011-06-01 18:25:07 -0700 | [diff] [blame] | 294 | } // namespace shill |