[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] network-nat: add domain info for nat-dhcpd


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Wei Kong <weikong.cn@xxxxxxxxx>
  • Date: Wed, 8 Apr 2009 18:10:07 +0800
  • Delivery-date: Wed, 08 Apr 2009 03:10:43 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Ddiz15GTH4KXEENsTBfWTDZrWanHIpr6Ys02ZleaUIcF1Tic3sM6q3mnaP+LdBh1pm PCuKKf+jx62wK2hawurWCjM5YaD6I55cocNb4ozw8ugOn9NS3NV33dOhaxrUL7MvsCPM I+58/T8hu+MzKGgSw7FX00Pkq2jcpEscFk5IY=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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/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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.