From: Wei Kong Subject: [PATCH] network-nat: add domain info for nat-dhcpd Date: Wed, 8 Apr 2009 18:10:07 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1114795908==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============1114795908== Content-Type: multipart/alternative; boundary=000e0cd214f6ff42f004670855a7 --000e0cd214f6ff42f004670855a7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Add domain info for nat-dhcpd. Signed-off-by: Wei Kong diff -uNrp xen-3.4.0-testing/tools/hotplug/Linux/network-nat xen-3.4.0-testing/tools/hotplug/Linux/network-nat --- xen-3.4.0-testing/tools/hotplug/Linux/network-nat 2009-04-08 17:31:50.000000000 +0800 +++ xen-3.4.0-testing/tools/hotplug/Linux/network-nat 2009-04-08 17:33:20.000000000 +0800 @@ -48,12 +48,16 @@ then fi fi +domain_name=`cat /etc/resolv.conf | grep -v "#" | grep -E 'search|domain' -i | tail -n 1 | awk '{ print $2 }'` +nameserver=`cat /etc/resolv.conf | grep -v "#" | grep "nameserver" -i -m 1 | awk '{ print $2 }'` function dhcp_start() { if ! grep -q "subnet 10.0.0.0" "$dhcpd_conf_file" then - echo >>"$dhcpd_conf_file" "subnet 10.0.0.0 netmask 255.255.0.0 {}" + echo >>"$dhcpd_conf_file" "subnet 10.0.0.0 netmask 255.255.0.0 {\ + option domain-name \"$domain_name\";\ + option domain-name-servers $nameserver; }" fi "$dhcpd_init_file" restart --000e0cd214f6ff42f004670855a7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Add domain info for nat-dhcpd.

Signed-off-by: Wei Kong <weikong.cn@gmail.com>

diff -uNrp xen-3.4.0= -testing/tools/hotplug/Linux/network-nat xen-3.4.0-testing/tools/hotplug/Li= nux/network-nat
--- xen-3.4.0-testing/tools/hotplug/Linux/network-nat=C2=A0=C2=A0 2009-04-0= 8 17:31:50.000000000 +0800
+++ xen-3.4.0-testing/tools/hotplug/Linux/net= work-nat=C2=A0=C2=A0 2009-04-08 17:33:20.000000000 +0800
@@ -48,12 +48,1= 6 @@ then
=C2=A0=C2=A0 fi
=C2=A0fi

+domain_name=3D`cat /etc/resolv.conf | grep -v "#"= ; | grep -E 'search|domain' -i | tail -n 1 | awk '{ print $2 }&= #39;`
+nameserver=3D`cat /etc/resolv.conf | grep -v "#" | grep= "nameserver" -i -m 1 | awk '{ print $2 }'`

=C2=A0function dhcp_start()
=C2=A0{
=C2=A0=C2=A0 if ! grep -q &qu= ot;subnet 10.0.0.0" "$dhcpd_conf_file"
=C2=A0=C2=A0 then<= br>-=C2=A0=C2=A0=C2=A0 echo >>"$dhcpd_conf_file" "subn= et 10.0.0.0 netmask 255.255.0.0 {}"
+=C2=A0=C2=A0=C2=A0 echo >>"$dhcpd_conf_file" "subnet = 10.0.0.0 netmask 255.255.0.0 {\
+ option domain-name \"$domain_name= \";\
+ option domain-name-servers $nameserver; }"
=C2=A0=C2= =A0 fi

=C2=A0=C2=A0 "$dhcpd_init_file" restart
--000e0cd214f6ff42f004670855a7-- --===============1114795908== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1114795908==--