diff options
author | Amol Mahesh <amahesh@codeaurora.org> | 2012-08-28 16:31:29 -0700 |
---|---|---|
committer | Robert Greenwalt <rgreenwalt@google.com> | 2012-11-16 11:55:53 -0800 |
commit | 400c611d3a71baccdfddb7bb085321d80db43fe4 (patch) | |
tree | f0f4ca6b6425f49466ef44988e87904386ca7c72 | |
parent | 859422d788687776f9b41c9ab677a61b21a616c0 (diff) | |
download | android_external_dhcpcd-400c611d3a71baccdfddb7bb085321d80db43fe4.tar.gz android_external_dhcpcd-400c611d3a71baccdfddb7bb085321d80db43fe4.tar.bz2 android_external_dhcpcd-400c611d3a71baccdfddb7bb085321d80db43fe4.zip |
DHCPCD: Set dhcp system property with the domain name.
Query the domain name from the Dhcp server and store it
in the dhcp system property.
Change-Id: I98be1c9a95168c6cd2a5e2c5d1431b201beff7e7
-rwxr-xr-x[-rw-r--r--] | android.conf | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | dhcpcd-hooks/20-dns.conf | 14 |
2 files changed, 15 insertions, 2 deletions
diff --git a/android.conf b/android.conf index 54006c7..bde048c 100644..100755 --- a/android.conf +++ b/android.conf @@ -3,4 +3,5 @@ interface wlan0 # dhcpcd-run-hooks uses these options. -option subnet_mask, routers, domain_name_servers +option subnet_mask, routers, domain_name_servers, domain_name, domain_search + diff --git a/dhcpcd-hooks/20-dns.conf b/dhcpcd-hooks/20-dns.conf index 6165824..d19c6a9 100644..100755 --- a/dhcpcd-hooks/20-dns.conf +++ b/dhcpcd-hooks/20-dns.conf @@ -18,12 +18,22 @@ set_dns_props() for i in 1 2 3 4; do setprop dhcp.${intf}.dns${i} "" done - + count=1 for dnsaddr in ${new_domain_name_servers}; do setprop dhcp.${intf}.dns${count} ${dnsaddr} count=$(($count + 1)) done + + separator=" " + if [ -z "$new_domain_name" ]; then + separator="" + else + if [ -z "$new_domain_search" ]; then + separator="" + fi + fi + setprop dhcp.${interface}.domain "${new_domain_name}$separator${new_domain_search}" } unset_dns_props() @@ -31,6 +41,8 @@ unset_dns_props() for i in 1 2 3 4; do setprop dhcp.${intf}.dns${i} "" done + + setprop dhcp.${interface}.domain "" } case "${reason}" in |