From c85683ef4bb402d103080bbcb2d70b23f9a5113e Mon Sep 17 00:00:00 2001 From: David Hill Date: Mon, 25 Mar 2013 16:27:25 -0400 Subject: [PATCH] Adding netmask to dnsmasq argument --dhcp-range By default, dnsmasq will try to guess the proper subnet size but sometimes it will fail. This patch provides the network netmask to dnsmasq via the --dhcp-range argument. Fixes: bug #1154929 Change-Id: I74d62c837b5310004b9151851697e3ea3b475f92 (cherry picked from commit fb151b5e3704c9a293f10ba89abc14f83d803c24) --- nova/network/linux_net.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py index 6c254f100ce..600d5e50d8c 100644 --- a/nova/network/linux_net.py +++ b/nova/network/linux_net.py @@ -870,9 +870,10 @@ def restart_dhcp(context, dev, network_ref): '--pid-file=%s' % _dhcp_file(dev, 'pid'), '--listen-address=%s' % network_ref['dhcp_server'], '--except-interface=lo', - '--dhcp-range=set:%s,%s,static,%ss' % + '--dhcp-range=set:%s,%s,static,%s,%ss' % (network_ref['label'], network_ref['dhcp_start'], + network_ref['netmask'], FLAGS.dhcp_lease_time), '--dhcp-lease-max=%s' % len(netaddr.IPNetwork(network_ref['cidr'])), '--dhcp-hostsfile=%s' % _dhcp_file(dev, 'conf'),