[libvirt] [PATCH 07/10] network: Bridge - don't offer dnsmasq DHCP services when DHCP relay is enabled

Laine Stump laine at laine.org
Thu Feb 28 20:08:16 UTC 2013


On 02/27/2013 09:57 PM, TJ wrote:
> From: TJ <linux at iam.tj>
>
> When dnsmasq's DNS services are required but the network is configured
> to use a DHCP relay agent (other than dnsmasq's proxy services) the
> configuration generated for dnsmasq should not enable DHCP services.
>
> Signed-off-by: TJ <linux at iam.tj>
> ---
>  src/network/bridge_driver.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index c02d3de..a4cd727 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -951,11 +951,12 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
>  
>      ipv4def = ipv6def = NULL;
>      ipdef = network->def->ipv4_dhcp;
> -    if (ipdef && (ipdef->nranges || ipdef->nhosts))
> +    if (ipdef && ipdef->dhcp_enabled && !ipdef->dhcp_relay &&
> +        (ipdef->nranges || ipdef->nhosts))
>          ipv4def = ipdef;
>  
>      ipdef = network->def->ipv6_dhcp;
> -    if (ipdef) {
> +    if (ipdef && ipdef->dhcp_enabled && !ipdef->dhcp_relay) {
>          if (ipdef->nranges || ipdef->nhosts) {
>              ipv6def = ipdef;
>  
> @@ -1266,8 +1267,8 @@ static int
>  networkRefreshDhcpDaemon(struct network_driver *driver,
>                           virNetworkObjPtr network)
>  {
> -    int ret = -1, ii;

You apparently removed the usage of ii in an earlier patch, but are
removing the definition of ii here. That would have cause a build
failure after applying the earlier patch. AS Eric mentioned, you must be
able to successfully complete an autogen.sh && make check && make
syntax-check after applying each patch in the series in sequence.
Otherwise, git bisect becomes unusable. (This is another argument for
integrating more into each patch).


> -    virNetworkIpDefPtr ipdef, ipv4def, ipv6def;
> +    int ret = -1;
> +    virNetworkIpDefPtr ipv4def, ipv6def;
>      dnsmasqContext *dctx = NULL;
>  
>      /* if no IP addresses specified, nothing to do */




More information about the libvir-list mailing list