[Feature][ZXW-65]merged P49 base code

Change-Id: I3e09c0c3d47483bc645f02310380ecb7fc6f4041
diff --git a/ap/app/Script/scripts/ppp_updown.sh b/ap/app/Script/scripts/ppp_updown.sh
index f36ea86..c9662d8 100755
--- a/ap/app/Script/scripts/ppp_updown.sh
+++ b/ap/app/Script/scripts/ppp_updown.sh
@@ -47,7 +47,7 @@
 
 	ps_ip=$ps_ip_ab"."$ps_ip_c1"."$ps_ip_d
 	
-	ifconfig $ps_if $ps_ip up
+	ifconfig $ps_if $ps_ip netmask 255.255.255.0 up
 	if [ $? -ne 0 ];then
 	    echo "Error: ifconfig $ps_if $ps_ip up failed." >> $test_log
     fi
@@ -98,6 +98,19 @@
 	route_info=`ip route|grep default`
 	
 	if [ "$route_info" == "" ];then
+		dns=`nv get $ps_if"_pridns"`
+		dns2=`nv get $ps_if"_secdns"`
+		if [ "-$dns" == "-" -o "-$dns" == "-0.0.0.0" ] && [ "-$dns2" == "-" -o "-$dns2" == "-0.0.0.0" ]; then
+			echo "Error:PPP no valid dns, use default dns." >> $test_log
+			dns="114.114.114.114"
+			dns2="8.8.8.8"
+		fi
+		if [ "-$dns" != "-" -a "-$dns" != "-0.0.0.0" ]; then
+			echo "nameserver $dns" >> /etc/resolv.conf
+		fi
+		if [ "-$dns2" != "-" -a "-$dns2" != "-0.0.0.0" ]; then
+			echo "nameserver $dns2" >> /etc/resolv.conf
+		fi
 		route add default dev $ps_if
 	else
 		echo "Debug: default route already exist." >> $test_log
@@ -477,6 +490,9 @@
 		linkdown_dhcpv6_server_set
 		route6_del
 		slaac_kill
+	fi
+	route_info=`ip route|grep default`
+	if [ "$route_info" == "" ];then
 		echo "" > /etc/resolv.conf
 	fi
 fi