summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThe Android Open Source Project2013-11-22 13:28:10 -0600
committerConley Owens2013-11-22 15:44:43 -0600
commit66ed50af6870210ce013a5588a688434a5d48ee9 (patch)
treea879f3ea31083496d0efe491bc187b6e0ebada39 /libnetutils
parentdd2ac3de625e6c0328a0f70530d8ade0d2151bfc (diff)
parent536dea9d61a032e64bbe584a97463c6638ead009 (diff)
downloadplatform-system-core-66ed50af6870210ce013a5588a688434a5d48ee9.tar.gz
platform-system-core-66ed50af6870210ce013a5588a688434a5d48ee9.tar.xz
platform-system-core-66ed50af6870210ce013a5588a688434a5d48ee9.zip
Merge commit '536dea9d61a032e64bbe584a97463c6638ead009' into HEAD
Change-Id: I5c469a4b738629d99d721cad7ded02d6c35f56d5
Diffstat (limited to 'libnetutils')
-rw-r--r--libnetutils/dhcp_utils.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/libnetutils/dhcp_utils.c b/libnetutils/dhcp_utils.c
index da00f7436..e1df87481 100644
--- a/libnetutils/dhcp_utils.c
+++ b/libnetutils/dhcp_utils.c
@@ -92,7 +92,8 @@ static int fill_ip_info(const char *interface,
92 char *server, 92 char *server,
93 uint32_t *lease, 93 uint32_t *lease,
94 char *vendorInfo, 94 char *vendorInfo,
95 char *domain) 95 char *domain,
96 char *mtu)
96{ 97{
97 char prop_name[PROPERTY_KEY_MAX]; 98 char prop_name[PROPERTY_KEY_MAX];
98 char prop_value[PROPERTY_VALUE_MAX]; 99 char prop_value[PROPERTY_VALUE_MAX];
@@ -158,6 +159,10 @@ static int fill_ip_info(const char *interface,
158 p2p_interface); 159 p2p_interface);
159 property_get(prop_name, domain, NULL); 160 property_get(prop_name, domain, NULL);
160 161
162 snprintf(prop_name, sizeof(prop_name), "%s.%s.mtu", DHCP_PROP_NAME_PREFIX,
163 p2p_interface);
164 property_get(prop_name, mtu, NULL);
165
161 return 0; 166 return 0;
162} 167}
163 168
@@ -186,7 +191,8 @@ int dhcp_do_request(const char *interface,
186 char *server, 191 char *server,
187 uint32_t *lease, 192 uint32_t *lease,
188 char *vendorInfo, 193 char *vendorInfo,
189 char *domain) 194 char *domain,
195 char *mtu)
190{ 196{
191 char result_prop_name[PROPERTY_KEY_MAX]; 197 char result_prop_name[PROPERTY_KEY_MAX];
192 char daemon_prop_name[PROPERTY_KEY_MAX]; 198 char daemon_prop_name[PROPERTY_KEY_MAX];
@@ -238,7 +244,7 @@ int dhcp_do_request(const char *interface,
238 if (strcmp(prop_value, "ok") == 0) { 244 if (strcmp(prop_value, "ok") == 0) {
239 char dns_prop_name[PROPERTY_KEY_MAX]; 245 char dns_prop_name[PROPERTY_KEY_MAX];
240 if (fill_ip_info(interface, ipaddr, gateway, prefixLength, dns, 246 if (fill_ip_info(interface, ipaddr, gateway, prefixLength, dns,
241 server, lease, vendorInfo, domain) == -1) { 247 server, lease, vendorInfo, domain, mtu) == -1) {
242 return -1; 248 return -1;
243 } 249 }
244 return 0; 250 return 0;
@@ -329,7 +335,8 @@ int dhcp_do_request_renew(const char *interface,
329 char *server, 335 char *server,
330 uint32_t *lease, 336 uint32_t *lease,
331 char *vendorInfo, 337 char *vendorInfo,
332 char *domain) 338 char *domain,
339 char *mtu)
333{ 340{
334 char result_prop_name[PROPERTY_KEY_MAX]; 341 char result_prop_name[PROPERTY_KEY_MAX];
335 char prop_value[PROPERTY_VALUE_MAX] = {'\0'}; 342 char prop_value[PROPERTY_VALUE_MAX] = {'\0'};
@@ -366,7 +373,7 @@ int dhcp_do_request_renew(const char *interface,
366 } 373 }
367 if (strcmp(prop_value, "ok") == 0) { 374 if (strcmp(prop_value, "ok") == 0) {
368 return fill_ip_info(interface, ipaddr, gateway, prefixLength, dns, 375 return fill_ip_info(interface, ipaddr, gateway, prefixLength, dns,
369 server, lease, vendorInfo, domain); 376 server, lease, vendorInfo, domain, mtu);
370 } else { 377 } else {
371 snprintf(errmsg, sizeof(errmsg), "DHCP Renew result was %s", prop_value); 378 snprintf(errmsg, sizeof(errmsg), "DHCP Renew result was %s", prop_value);
372 return -1; 379 return -1;