iface->addressEntries << entry;
+#ifdef SIOCGIFHWADDR // not defined on FreeBSD
struct ifreq req;
::memset(&req, 0, sizeof(ifreq));
::memcpy(req.ifr_name, ptr->ifa_name, sizeof(req.ifr_name) - 1);
uchar *addr = (uchar *)req.ifr_addr.sa_data;
iface->hardwareAddress = iface->makeHwAddress(addr);
}
+#endif // SIOCGIFHWADDR
}
::freeifaddrs(interfaceListing);
// reset the name:
::memcpy(req.ifr_name, oldName.constData(), qMin<int>(oldName.length() + 1, sizeof(req.ifr_name) - 1));
} else
-#endif
+#endif // SIOCGIFNAME
{
// use this name anyways
iface->name = QString::fromLatin1(req.ifr_name);
iface->flags = convertFlags(req.ifr_flags);
}
+#ifdef SIOCGIFHWADDR // not defined on FreeBSD
// Get the HW address
if (::ioctl(socket, SIOCGIFHWADDR, &req) >= 0) {
uchar *addr = (uchar *)req.ifr_addr.sa_data;
iface->hardwareAddress = iface->makeHwAddress(addr);
}
+#endif // SIOCGIFHWADDR
return iface;
}