Skip to contentSkip to conversation

network-nat: add domain info for nat-dhcpd

PATCH New Wei Kong 1 participant 1 message Apr 8, 2009

lore
Share & tools
lore

Wei Kong

author
#0 lore raw

PATCH 1/1 network-nat: add domain info for nat-dhcpd

Add domain info for nat-dhcpd.

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
[email protected]
http://lists.xensource.com/xen-devel