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
diff --git a/android.conf b/android.conf
old mode 100644
new mode 100755
index 54006c7..bde048c
--- 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
old mode 100644
new mode 100755
index 6165824..d19c6a9
--- a/dhcpcd-hooks/20-dns.conf
+++ b/dhcpcd-hooks/20-dns.conf
@@ -18,12 +18,22 @@
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 @@
for i in 1 2 3 4; do
setprop dhcp.${intf}.dns${i} ""
done
+
+ setprop dhcp.${interface}.domain ""
}
case "${reason}" in