]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: dnsmasq: mandate at least version 2.67
authorJán Tomko <jtomko@redhat.com>
Tue, 14 Dec 2021 16:36:23 +0000 (17:36 +0100)
committerJán Tomko <jtomko@redhat.com>
Wed, 15 Dec 2021 14:28:17 +0000 (15:28 +0100)
All the capabilities should be supported in 2.67.
Make this the minimum version, since even the oldest
distros we support have moved on:

Debian 8: 2.72
CentOS 7: 2.76
Ubuntu 18.04: 2.79

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/util/virdnsmasq.c

index 90a1ea35b6ae278256129fc2218d0692c8afcd67..f7743953e69739a583f66cb2c547a7fef5be5327 100644 (file)
@@ -49,6 +49,9 @@ VIR_LOG_INIT("util.dnsmasq");
 #define DNSMASQ_HOSTSFILE_SUFFIX "hostsfile"
 #define DNSMASQ_ADDNHOSTSFILE_SUFFIX "addnhosts"
 
+#define DNSMASQ_MIN_MAJOR 2
+#define DNSMASQ_MIN_MINOR 67
+
 static void
 dhcphostFreeContent(dnsmasqDhcpHost *host)
 {
@@ -627,6 +630,15 @@ dnsmasqCapsSetFromBuffer(dnsmasqCaps *caps, const char *buf)
     if (virParseVersionString(p, &caps->version, true) < 0)
         goto error;
 
+    if (caps->version < DNSMASQ_MIN_MAJOR * 1000000 + DNSMASQ_MIN_MINOR * 1000) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("dnsmasq version >= %u.%u required but %lu.%lu found"),
+                       DNSMASQ_MIN_MAJOR, DNSMASQ_MIN_MINOR,
+                       caps->version / 1000000,
+                       caps->version % 1000000 / 1000);
+        goto error;
+    }
+
     if (strstr(buf, "--bind-dynamic"))
         dnsmasqCapsSet(caps, DNSMASQ_CAPS_BIND_DYNAMIC);