Reported by Rafał Wojciechowski <it@xxxxxxxxxxxxxxxxxxxxx>. Thread 1 (Thread 0x7f194b99d700 (LWP 5631)): 0 virNetDevGetifaddrsAddress (addr=0x7f194b99c7c0, ifname=0x7f193400e2b0 "ovirtmgmt") at util/virnetdevip.c:738 1 virNetDevIPAddrGet (ifname=0x7f193400e2b0 "ovirtmgmt", addr=addr@entry=0x7f194b99c7c0) at util/virnetdevip.c:795 2 0x00007f19467800d6 in networkGetNetworkAddress (netname=<optimized out>, netaddr=netaddr@entry=0x7f1924013f18) at network/bridge_driver.c:4780 3 0x00007f193e43a33c in qemuProcessGraphicsSetupNetworkAddress (listenAddr=0x7f19340f7650 "127.0.0.1", glisten=0x7f1924013f10) at qemu/qemu_process.c:4062 4 qemuProcessGraphicsSetupListen (vm=<optimized out>, graphics=0x7f1924014f10, cfg=0x7f1934119f00) at qemu/qemu_process.c:4133 5 qemuProcessSetupGraphics (flags=17, vm=0x7f19240155d0, driver=0x7f193411f1d0) at qemu/qemu_process.c:4196 6 qemuProcessPrepareDomain (conn=conn@entry=0x7f192c00ab50, driver=driver@entry=0x7f193411f1d0, vm=vm@entry=0x7f19240155d0, flags=flags@entry=17) at qemu/qemu_process.c:4969 7 0x00007f193e4417c0 in qemuProcessStart (conn=conn@entry=0x7f192c00ab50, driver=driver@entry=0x7f193411f1d0, vm=0x7f19240155d0,asyncJob=asyncJob@entry=QEMU_ASYNC_JOB_START, migrateFrom=migrateFrom@entry=0x0, migrateFd=migrateFd@entry=-1, migratePath=migratePath@entry=0x0,snapshot=snapshot@entry=0x0, vmop=vmop@entry=VIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=17, flags@entry=1) at qemu/qemu_process.c:5553 Man page for getifaddrs also states that the "ifa_addr" may contain a null pointer which happens if there is an existing network interface on the host without IP address. Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- src/util/virnetdevip.c | 7 ++++++- src/util/virnetdevtap.c | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index 726fa6c3e3..09925e1d74 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -902,10 +902,15 @@ virNetDevGetifaddrsAddress(const char *ifname, } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - int family = ifa->ifa_addr->sa_family; + int family; if (STRNEQ_NULLABLE(ifa->ifa_name, ifname)) continue; + + if (!ifa->ifa_addr) + continue; + family = ifa->ifa_addr->sa_family; + if (family != AF_INET6 && family != AF_INET) continue; diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 02ef7fd240..93002b9294 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -762,6 +762,9 @@ virNetDevTapInterfaceStats(const char *ifname, } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { + if (!ifa->ifa_addr) + continue; + if (ifa->ifa_addr->sa_family != AF_LINK) continue; -- 2.12.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list