]> xenbits.xensource.com Git - libvirt.git/commitdiff
loopback is not always just lo
authorPavel Timofeev <timp87@gmail.com>
Tue, 1 Nov 2016 15:15:59 +0000 (18:15 +0300)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 2 Nov 2016 18:10:39 +0000 (18:10 +0000)
 On BSD family OSes (Free/Net/Open/DragonFlyBSD, Mac OS) and
 Solaris loopback interface is called 'lo0' instead of just 'lo'.

src/network/bridge_driver.c

index a3ee3f364ec99a81598b9daa171e4367e78b0d9d..9d94d65b4e2f7115082eb29bcf487d05d2d90913 100644 (file)
@@ -1002,7 +1002,12 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
         virBufferAsprintf(&configbuf, "pid-file=%s\n", pidfile);
 
     /* dnsmasq will *always* listen on localhost unless told otherwise */
+#ifdef __linux__
     virBufferAddLit(&configbuf, "except-interface=lo\n");
+#else
+    /* BSD family OSes and Solaris call loopback interface as lo0 */
+    virBufferAddLit(&configbuf, "except-interface=lo0\n");
+#endif
 
     if (dnsmasqCapsGet(caps, DNSMASQ_CAPS_BIND_DYNAMIC)) {
         /* using --bind-dynamic with only --interface (no