Skip to content

Commit 8babd39

Browse files
bvbharatJayapal
authored andcommitted
CLOUDSTACK-4132 current dnsmasq config does not allow guest virtual machines(clients) to update its hostnames with a DNS server
Introducing the option dhcp-client-update fails if the dnsmasq version is less than 2.6 (like in older templates). Added a check for the version in cloud-early-config. will add dhcp-client-update option in the config file only if the dnsmasq version is 2.6 and above. Signed-off-by: Jayapal <jayapal@apache.org>
1 parent 76d3cae commit 8babd39

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎patches/systemvm/debian/config/etc/init.d/cloud-early-config‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,15 @@ setup_dnsmasq() {
724724
then
725725
echo "$ETH0_IP6 data-server" >> /etc/hosts
726726
fi
727+
#add the dhcp-client-update only if dnsmasq version is 2.6 and above
728+
dnsmasqVersion=$(dnsmasq -v | grep version -m 1 | grep -o "[[:digit:]]\.[[:digit:]]")
729+
major=$(echo "$dnsmasqVersion" | cut -d '.' -f 1)
730+
minor=$(echo "$dnsmasqVersion" | cut -d '.' -f 2)
731+
if [ "$major" -eq '2' -a "$minor" -ge '6' ] || [ "$major" -gt '2' ]
732+
then
733+
sed -i -e "/^dhcp-client-update/d" /etc/dnsmasq.conf
734+
echo 'dhcp-client-update' >> /etc/dnsmasq.conf
735+
fi
727736
}
728737

729738
setup_sshd(){

0 commit comments

Comments
 (0)