From: Pavel Timofeev Date: Tue, 1 Nov 2016 15:15:59 +0000 (+0300) Subject: loopback is not always just lo X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=478ddedc12b77313cbaf72328ab2236ce7c56ead;p=libvirt.git loopback is not always just lo On BSD family OSes (Free/Net/Open/DragonFlyBSD, Mac OS) and Solaris loopback interface is called 'lo0' instead of just 'lo'. --- diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index a3ee3f364e..9d94d65b4e 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -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