From: Jonathan Calmels Date: Fri, 8 Dec 2017 06:15:10 +0000 (-0800) Subject: lxc-net: add LXC_DHCP_PING boolean option X-Git-Tag: lxc-3.0.0.beta1~98^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbb8e190f1102e8c012533b706d56ace53f5cd79;p=thirdparty%2Flxc.git lxc-net: add LXC_DHCP_PING boolean option Excerpt from dnsmasq(8): By default, the DHCP server will attempt to ensure that an address in not in use before allocating it to a host. It does this by sending an ICMP echo request (aka "ping") to the address in question. If it gets a reply, then the address must already be in use, and another is tried. This flag disables this check. This is useful if one expects all the containers to get an IP address from the LXC authoritative DHCP server and wants to speed up the process of getting a lease. Signed-off-by: Jonathan Calmels --- diff --git a/config/init/common/lxc-net.in b/config/init/common/lxc-net.in index a9683f29d..ddbd4aaab 100644 --- a/config/init/common/lxc-net.in +++ b/config/init/common/lxc-net.in @@ -16,6 +16,7 @@ LXC_NETWORK="10.0.3.0/24" LXC_DHCP_RANGE="10.0.3.2,10.0.3.254" LXC_DHCP_MAX="253" LXC_DHCP_CONFILE="" +LXC_DHCP_PING="true" LXC_DOMAIN="" LXC_IPV6_ADDR="" @@ -127,7 +128,12 @@ start() { fi done - dnsmasq $LXC_DHCP_CONFILE_ARG $LXC_DOMAIN_ARG -u ${DNSMASQ_USER} \ + LXC_DHCP_PING_ARG="" + if [ "x$LXC_DHCP_PING" = "xfalse" ]; then + LXC_DHCP_PING_ARG="--no-ping" + fi + + dnsmasq $LXC_DHCP_CONFILE_ARG $LXC_DOMAIN_ARG $LXC_DHCP_PING_ARG -u ${DNSMASQ_USER} \ --strict-order --bind-interfaces --pid-file="${varrun}"/dnsmasq.pid \ --listen-address ${LXC_ADDR} --dhcp-range ${LXC_DHCP_RANGE} \ --dhcp-lease-max=${LXC_DHCP_MAX} --dhcp-no-override \