From d07b07bfa87d8e1fab2854a47859e2f4c9a0acde Mon Sep 17 00:00:00 2001 From: Chiradeep Vittal Date: Mon, 7 Mar 2011 16:18:04 -0800 Subject: [PATCH] bug 8892: accept nameserver configurations on non-default networks. this is because if dnsmasq sends no nameservers, dhclient deletes all entries from resolv.conf. the MS will send the eth0 ip of the dhcp server / virtual router on the default network as the nameserver on the non-default networks --- .../systemvm/debian/config/etc/init.d/cloud-early-config | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index cdeac3fdfc4..7b402ec6755 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -285,17 +285,21 @@ setup_dhcpsrvr() { setup_dnsmasq setup_apache2 $ETH0_IP + NS=$NS1 + [ -n "$NS2" ] && NS=$NS1,$NS2 + if [ "$DEFAULTROUTE" != "false" ] then sed -i -e "/^[#]*dhcp-option=option:router.*$/d" /etc/dnsmasq.conf echo "dhcp-option=option:router,$GW" >> /etc/dnsmasq.conf #for now set up ourself as the dns server as well sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf - echo "dhcp-option=6,$ETH0_IP,$NS1,$NS2" >> /etc/dnsmasq.conf + echo "dhcp-option=6,$ETH0_IP,$NS" >> /etc/dnsmasq.conf else sed -i -e "/^[#]*dhcp-option=option:router.*$/d" /etc/dnsmasq.conf echo "dhcp-option=option:router" >> /etc/dnsmasq.conf sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf + echo "dhcp-option=6,$NS" >> /etc/dnsmasq.conf fi sed -i /gateway/d /etc/hosts