blob: 0f7c384c5c0909aebbf9941028aeac226c892da1 [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001/*
2 * Copyright 2008, The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/* Utilities for managing the dhcpcd DHCP client daemon */
18
19#include <stdio.h>
20#include <stdlib.h>
Olivier Baillyb93e5812010-11-17 11:47:23 -080021#include <string.h>
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080022#include <unistd.h>
23#include <arpa/inet.h>
24#include <netinet/in.h>
25
26#include <cutils/properties.h>
27
Dmitry Shmidt9363b7d2009-12-14 15:41:54 -080028static const char DAEMON_NAME[] = "dhcpcd";
29static const char DAEMON_PROP_NAME[] = "init.svc.dhcpcd";
30static const char HOSTNAME_PROP_NAME[] = "net.hostname";
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080031static const char DHCP_PROP_NAME_PREFIX[] = "dhcp";
Dmitry Shmidt62d6f742012-07-23 17:39:30 -070032static const char DHCP_CONFIG_PATH[] = "/system/etc/dhcpcd/dhcpcd.conf";
Irfan Sheriffb1723b62010-12-21 10:31:05 -080033static const int NAP_TIME = 200; /* wait for 200ms at a time */
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080034 /* when polling for property values */
TK MUN9d157872011-02-23 18:58:36 +090035static const char DAEMON_NAME_RENEW[] = "iprenew";
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080036static char errmsg[100];
Irfan Sheriff89f58cf2012-05-23 10:30:05 -070037/* interface length for dhcpcd daemon start (dhcpcd_<interface> as defined in init.rc file)
38 * or for filling up system properties dhcpcd.<interface>.ipaddress, dhcpcd.<interface>.dns1
39 * and other properties on a successful bind
40 */
41#define MAX_INTERFACE_LENGTH 25
42
43/*
44 * P2p interface names increase sequentially p2p-p2p0-1, p2p-p2p0-2.. after
45 * group formation. This does not work well with system properties which can quickly
46 * exhaust or for specifiying a dhcp start target in init which requires
47 * interface to be pre-defined in init.rc file.
48 *
49 * This function returns a common string p2p for all p2p interfaces.
50 */
51void get_p2p_interface_replacement(const char *interface, char *p2p_interface) {
52 /* Use p2p for any interface starting with p2p. */
53 if (strncmp(interface, "p2p",3) == 0) {
54 strncpy(p2p_interface, "p2p", MAX_INTERFACE_LENGTH);
55 } else {
56 strncpy(p2p_interface, interface, MAX_INTERFACE_LENGTH);
57 }
58}
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080059
60/*
61 * Wait for a system property to be assigned a specified value.
62 * If desired_value is NULL, then just wait for the property to
63 * be created with any value. maxwait is the maximum amount of
64 * time in seconds to wait before giving up.
65 */
66static int wait_for_property(const char *name, const char *desired_value, int maxwait)
67{
68 char value[PROPERTY_VALUE_MAX] = {'\0'};
Irfan Sheriffb1723b62010-12-21 10:31:05 -080069 int maxnaps = (maxwait * 1000) / NAP_TIME;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080070
71 if (maxnaps < 1) {
72 maxnaps = 1;
73 }
74
75 while (maxnaps-- > 0) {
Irfan Sheriffb1723b62010-12-21 10:31:05 -080076 usleep(NAP_TIME * 1000);
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080077 if (property_get(name, value, NULL)) {
78 if (desired_value == NULL ||
79 strcmp(value, desired_value) == 0) {
80 return 0;
81 }
82 }
83 }
84 return -1; /* failure */
85}
86
Robert Greenwaltfaab26d2011-01-14 14:35:42 -080087static int fill_ip_info(const char *interface,
88 char *ipaddr,
89 char *gateway,
90 uint32_t *prefixLength,
Robert Greenwaltfdd57312013-01-09 16:22:12 -080091 char *dns[],
Robert Greenwaltfaab26d2011-01-14 14:35:42 -080092 char *server,
Jeff Sharkey0fb8ec82012-04-18 21:54:55 -070093 uint32_t *lease,
Robert Greenwalt6ecbdca2012-11-13 10:56:01 -080094 char *vendorInfo,
Dmitry Shmidtbe062102013-07-24 17:37:05 -070095 char *domain,
96 char *mtu)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080097{
98 char prop_name[PROPERTY_KEY_MAX];
99 char prop_value[PROPERTY_VALUE_MAX];
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700100 /* Interface name after converting p2p0-p2p0-X to p2p to reuse system properties */
101 char p2p_interface[MAX_INTERFACE_LENGTH];
Robert Greenwaltfdd57312013-01-09 16:22:12 -0800102 int x;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800103
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700104 get_p2p_interface_replacement(interface, p2p_interface);
105
106 snprintf(prop_name, sizeof(prop_name), "%s.%s.ipaddress", DHCP_PROP_NAME_PREFIX, p2p_interface);
Robert Greenwaltfaab26d2011-01-14 14:35:42 -0800107 property_get(prop_name, ipaddr, NULL);
108
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700109 snprintf(prop_name, sizeof(prop_name), "%s.%s.gateway", DHCP_PROP_NAME_PREFIX, p2p_interface);
Robert Greenwaltfaab26d2011-01-14 14:35:42 -0800110 property_get(prop_name, gateway, NULL);
111
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700112 snprintf(prop_name, sizeof(prop_name), "%s.%s.server", DHCP_PROP_NAME_PREFIX, p2p_interface);
Irfan Sheriffbdaaec12011-04-15 16:04:24 -0700113 property_get(prop_name, server, NULL);
114
115 //TODO: Handle IPv6 when we change system property usage
Irfan Sheriff94cecfc2012-12-07 10:36:29 -0800116 if (gateway[0] == '\0' || strncmp(gateway, "0.0.0.0", 7) == 0) {
Irfan Sheriffbdaaec12011-04-15 16:04:24 -0700117 //DHCP server is our best bet as gateway
118 strncpy(gateway, server, PROPERTY_VALUE_MAX);
119 }
120
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700121 snprintf(prop_name, sizeof(prop_name), "%s.%s.mask", DHCP_PROP_NAME_PREFIX, p2p_interface);
Robert Greenwaltfaab26d2011-01-14 14:35:42 -0800122 if (property_get(prop_name, prop_value, NULL)) {
123 int p;
124 // this conversion is v4 only, but this dhcp client is v4 only anyway
125 in_addr_t mask = ntohl(inet_addr(prop_value));
126 // Check netmask is a valid IP address. ntohl gives NONE response (all 1's) for
127 // non 255.255.255.255 inputs. if we get that value check if it is legit..
128 if (mask == INADDR_NONE && strcmp(prop_value, "255.255.255.255") != 0) {
129 snprintf(errmsg, sizeof(errmsg), "DHCP gave invalid net mask %s", prop_value);
130 return -1;
131 }
132 for (p = 0; p < 32; p++) {
133 if (mask == 0) break;
134 // check for non-contiguous netmask, e.g., 255.254.255.0
135 if ((mask & 0x80000000) == 0) {
136 snprintf(errmsg, sizeof(errmsg), "DHCP gave invalid net mask %s", prop_value);
137 return -1;
138 }
139 mask = mask << 1;
140 }
141 *prefixLength = p;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800142 }
Robert Greenwaltfaab26d2011-01-14 14:35:42 -0800143
Robert Greenwaltfdd57312013-01-09 16:22:12 -0800144 for (x=0; dns[x] != NULL; x++) {
145 snprintf(prop_name, sizeof(prop_name), "%s.%s.dns%d", DHCP_PROP_NAME_PREFIX, p2p_interface, x+1);
146 property_get(prop_name, dns[x], NULL);
147 }
Robert Greenwaltfaab26d2011-01-14 14:35:42 -0800148
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700149 snprintf(prop_name, sizeof(prop_name), "%s.%s.leasetime", DHCP_PROP_NAME_PREFIX, p2p_interface);
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800150 if (property_get(prop_name, prop_value, NULL)) {
151 *lease = atol(prop_value);
152 }
Jeff Sharkey0fb8ec82012-04-18 21:54:55 -0700153
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700154 snprintf(prop_name, sizeof(prop_name), "%s.%s.vendorInfo", DHCP_PROP_NAME_PREFIX,
155 p2p_interface);
Jeff Sharkey0fb8ec82012-04-18 21:54:55 -0700156 property_get(prop_name, vendorInfo, NULL);
157
Robert Greenwalt6ecbdca2012-11-13 10:56:01 -0800158 snprintf(prop_name, sizeof(prop_name), "%s.%s.domain", DHCP_PROP_NAME_PREFIX,
159 p2p_interface);
160 property_get(prop_name, domain, NULL);
161
Dmitry Shmidtbe062102013-07-24 17:37:05 -0700162 snprintf(prop_name, sizeof(prop_name), "%s.%s.mtu", DHCP_PROP_NAME_PREFIX,
163 p2p_interface);
164 property_get(prop_name, mtu, NULL);
165
Robert Greenwaltfaab26d2011-01-14 14:35:42 -0800166 return 0;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800167}
168
169/*
170 * Start the dhcp client daemon, and wait for it to finish
171 * configuring the interface.
Irfan Sheriff35c28602011-11-09 11:10:50 -0800172 *
173 * The device init.rc file needs a corresponding entry for this work.
174 *
175 * Example:
Dmitry Shmidt62d6f742012-07-23 17:39:30 -0700176 * service dhcpcd_<interface> /system/bin/dhcpcd -ABKL -f dhcpcd.conf
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800177 */
178int dhcp_do_request(const char *interface,
Robert Greenwaltfaab26d2011-01-14 14:35:42 -0800179 char *ipaddr,
180 char *gateway,
181 uint32_t *prefixLength,
Robert Greenwaltfdd57312013-01-09 16:22:12 -0800182 char *dns[],
Robert Greenwaltfaab26d2011-01-14 14:35:42 -0800183 char *server,
Jeff Sharkey0fb8ec82012-04-18 21:54:55 -0700184 uint32_t *lease,
Robert Greenwalt6ecbdca2012-11-13 10:56:01 -0800185 char *vendorInfo,
Dmitry Shmidtbe062102013-07-24 17:37:05 -0700186 char *domain,
187 char *mtu)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800188{
189 char result_prop_name[PROPERTY_KEY_MAX];
TK MUN9d157872011-02-23 18:58:36 +0900190 char daemon_prop_name[PROPERTY_KEY_MAX];
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800191 char prop_value[PROPERTY_VALUE_MAX] = {'\0'};
Dmitry Shmidt62d6f742012-07-23 17:39:30 -0700192 char daemon_cmd[PROPERTY_VALUE_MAX * 2 + sizeof(DHCP_CONFIG_PATH)];
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800193 const char *ctrl_prop = "ctl.start";
194 const char *desired_status = "running";
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700195 /* Interface name after converting p2p0-p2p0-X to p2p to reuse system properties */
196 char p2p_interface[MAX_INTERFACE_LENGTH];
repo synca329b422011-07-29 12:07:34 -0700197
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700198 get_p2p_interface_replacement(interface, p2p_interface);
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800199
200 snprintf(result_prop_name, sizeof(result_prop_name), "%s.%s.result",
201 DHCP_PROP_NAME_PREFIX,
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700202 p2p_interface);
TK MUN9d157872011-02-23 18:58:36 +0900203
204 snprintf(daemon_prop_name, sizeof(daemon_prop_name), "%s_%s",
205 DAEMON_PROP_NAME,
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700206 p2p_interface);
TK MUN9d157872011-02-23 18:58:36 +0900207
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800208 /* Erase any previous setting of the dhcp result property */
209 property_set(result_prop_name, "");
210
211 /* Start the daemon and wait until it's ready */
Dmitry Shmidt9363b7d2009-12-14 15:41:54 -0800212 if (property_get(HOSTNAME_PROP_NAME, prop_value, NULL) && (prop_value[0] != '\0'))
Dmitry Shmidt62d6f742012-07-23 17:39:30 -0700213 snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:-f %s -h %s %s", DAEMON_NAME,
214 p2p_interface, DHCP_CONFIG_PATH, prop_value, interface);
Dmitry Shmidt9363b7d2009-12-14 15:41:54 -0800215 else
Dmitry Shmidt62d6f742012-07-23 17:39:30 -0700216 snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:-f %s %s", DAEMON_NAME,
Matt Gumbelba2ba5c2013-01-04 09:53:42 -0800217 p2p_interface, DHCP_CONFIG_PATH, interface);
Dmitry Shmidt9363b7d2009-12-14 15:41:54 -0800218 memset(prop_value, '\0', PROPERTY_VALUE_MAX);
219 property_set(ctrl_prop, daemon_cmd);
TK MUN9d157872011-02-23 18:58:36 +0900220 if (wait_for_property(daemon_prop_name, desired_status, 10) < 0) {
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800221 snprintf(errmsg, sizeof(errmsg), "%s", "Timed out waiting for dhcpcd to start");
222 return -1;
223 }
224
225 /* Wait for the daemon to return a result */
226 if (wait_for_property(result_prop_name, NULL, 30) < 0) {
227 snprintf(errmsg, sizeof(errmsg), "%s", "Timed out waiting for DHCP to finish");
228 return -1;
229 }
230
231 if (!property_get(result_prop_name, prop_value, NULL)) {
232 /* shouldn't ever happen, given the success of wait_for_property() */
233 snprintf(errmsg, sizeof(errmsg), "%s", "DHCP result property was not set");
234 return -1;
235 }
236 if (strcmp(prop_value, "ok") == 0) {
Robert Greenwaltfdd57312013-01-09 16:22:12 -0800237 if (fill_ip_info(interface, ipaddr, gateway, prefixLength, dns,
Dmitry Shmidtbe062102013-07-24 17:37:05 -0700238 server, lease, vendorInfo, domain, mtu) == -1) {
Robert Greenwaltfaab26d2011-01-14 14:35:42 -0800239 return -1;
240 }
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800241 return 0;
242 } else {
243 snprintf(errmsg, sizeof(errmsg), "DHCP result was %s", prop_value);
244 return -1;
245 }
246}
247
248/**
249 * Stop the DHCP client daemon.
250 */
251int dhcp_stop(const char *interface)
252{
253 char result_prop_name[PROPERTY_KEY_MAX];
TK MUN9d157872011-02-23 18:58:36 +0900254 char daemon_prop_name[PROPERTY_KEY_MAX];
255 char daemon_cmd[PROPERTY_VALUE_MAX * 2];
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800256 const char *ctrl_prop = "ctl.stop";
257 const char *desired_status = "stopped";
258
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700259 char p2p_interface[MAX_INTERFACE_LENGTH];
repo synca329b422011-07-29 12:07:34 -0700260
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700261 get_p2p_interface_replacement(interface, p2p_interface);
repo synca329b422011-07-29 12:07:34 -0700262
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800263 snprintf(result_prop_name, sizeof(result_prop_name), "%s.%s.result",
264 DHCP_PROP_NAME_PREFIX,
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700265 p2p_interface);
TK MUN9d157872011-02-23 18:58:36 +0900266
267 snprintf(daemon_prop_name, sizeof(daemon_prop_name), "%s_%s",
268 DAEMON_PROP_NAME,
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700269 p2p_interface);
TK MUN9d157872011-02-23 18:58:36 +0900270
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700271 snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s", DAEMON_NAME, p2p_interface);
TK MUN9d157872011-02-23 18:58:36 +0900272
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800273 /* Stop the daemon and wait until it's reported to be stopped */
TK MUN9d157872011-02-23 18:58:36 +0900274 property_set(ctrl_prop, daemon_cmd);
275 if (wait_for_property(daemon_prop_name, desired_status, 5) < 0) {
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800276 return -1;
277 }
278 property_set(result_prop_name, "failed");
279 return 0;
280}
281
282/**
283 * Release the current DHCP client lease.
284 */
285int dhcp_release_lease(const char *interface)
286{
TK MUN9d157872011-02-23 18:58:36 +0900287 char daemon_prop_name[PROPERTY_KEY_MAX];
288 char daemon_cmd[PROPERTY_VALUE_MAX * 2];
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800289 const char *ctrl_prop = "ctl.stop";
290 const char *desired_status = "stopped";
291
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700292 char p2p_interface[MAX_INTERFACE_LENGTH];
repo synca329b422011-07-29 12:07:34 -0700293
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700294 get_p2p_interface_replacement(interface, p2p_interface);
repo synca329b422011-07-29 12:07:34 -0700295
TK MUN9d157872011-02-23 18:58:36 +0900296 snprintf(daemon_prop_name, sizeof(daemon_prop_name), "%s_%s",
297 DAEMON_PROP_NAME,
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700298 p2p_interface);
TK MUN9d157872011-02-23 18:58:36 +0900299
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700300 snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s", DAEMON_NAME, p2p_interface);
TK MUN9d157872011-02-23 18:58:36 +0900301
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800302 /* Stop the daemon and wait until it's reported to be stopped */
TK MUN9d157872011-02-23 18:58:36 +0900303 property_set(ctrl_prop, daemon_cmd);
304 if (wait_for_property(daemon_prop_name, desired_status, 5) < 0) {
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800305 return -1;
306 }
307 return 0;
308}
309
310char *dhcp_get_errmsg() {
311 return errmsg;
312}
TK MUN9d157872011-02-23 18:58:36 +0900313
314/**
Irfan Sheriff35c28602011-11-09 11:10:50 -0800315 * The device init.rc file needs a corresponding entry.
316 *
317 * Example:
318 * service iprenew_<interface> /system/bin/dhcpcd -n
319 *
TK MUN9d157872011-02-23 18:58:36 +0900320 */
321int dhcp_do_request_renew(const char *interface,
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700322 char *ipaddr,
323 char *gateway,
tk.muned216332011-10-13 22:58:55 +0900324 uint32_t *prefixLength,
Robert Greenwaltfdd57312013-01-09 16:22:12 -0800325 char *dns[],
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700326 char *server,
Jeff Sharkey0fb8ec82012-04-18 21:54:55 -0700327 uint32_t *lease,
Robert Greenwalt6ecbdca2012-11-13 10:56:01 -0800328 char *vendorInfo,
Dmitry Shmidtbe062102013-07-24 17:37:05 -0700329 char *domain,
330 char *mtu)
TK MUN9d157872011-02-23 18:58:36 +0900331{
332 char result_prop_name[PROPERTY_KEY_MAX];
333 char prop_value[PROPERTY_VALUE_MAX] = {'\0'};
334 char daemon_cmd[PROPERTY_VALUE_MAX * 2];
335 const char *ctrl_prop = "ctl.start";
336
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700337 char p2p_interface[MAX_INTERFACE_LENGTH];
repo synca329b422011-07-29 12:07:34 -0700338
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700339 get_p2p_interface_replacement(interface, p2p_interface);
repo synca329b422011-07-29 12:07:34 -0700340
TK MUN9d157872011-02-23 18:58:36 +0900341 snprintf(result_prop_name, sizeof(result_prop_name), "%s.%s.result",
342 DHCP_PROP_NAME_PREFIX,
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700343 p2p_interface);
TK MUN9d157872011-02-23 18:58:36 +0900344
345 /* Erase any previous setting of the dhcp result property */
346 property_set(result_prop_name, "");
347
348 /* Start the renew daemon and wait until it's ready */
repo synca329b422011-07-29 12:07:34 -0700349 snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:%s", DAEMON_NAME_RENEW,
Irfan Sheriff89f58cf2012-05-23 10:30:05 -0700350 p2p_interface, interface);
TK MUN9d157872011-02-23 18:58:36 +0900351 memset(prop_value, '\0', PROPERTY_VALUE_MAX);
352 property_set(ctrl_prop, daemon_cmd);
353
354 /* Wait for the daemon to return a result */
355 if (wait_for_property(result_prop_name, NULL, 30) < 0) {
356 snprintf(errmsg, sizeof(errmsg), "%s", "Timed out waiting for DHCP Renew to finish");
357 return -1;
358 }
359
360 if (!property_get(result_prop_name, prop_value, NULL)) {
361 /* shouldn't ever happen, given the success of wait_for_property() */
362 snprintf(errmsg, sizeof(errmsg), "%s", "DHCP Renew result property was not set");
363 return -1;
364 }
365 if (strcmp(prop_value, "ok") == 0) {
Colin Cross0a0a8762013-06-10 15:06:43 -0700366 return fill_ip_info(interface, ipaddr, gateway, prefixLength, dns,
Dmitry Shmidtbe062102013-07-24 17:37:05 -0700367 server, lease, vendorInfo, domain, mtu);
TK MUN9d157872011-02-23 18:58:36 +0900368 } else {
369 snprintf(errmsg, sizeof(errmsg), "DHCP Renew result was %s", prop_value);
370 return -1;
371 }
372}