]> xenbits.xensource.com Git - libvirt.git/commitdiff
virnetdev: stub virNetDev{Add,Del}Multi on FreeBSD
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Wed, 29 Oct 2014 18:20:47 +0000 (21:20 +0300)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Thu, 30 Oct 2014 04:59:39 +0000 (07:59 +0300)
Currently, build fails on FreeBSD because its struct ifreq does not
have ifr_hwaddr member. In order to fix that, check if this member
is present, otherwise fall back to the stub version of the
virNetDev{Add,Del}Multi functions.

configure.ac
src/util/virnetdev.c

index f7b02ff80e417d730522d913aad0ca701b411ff7..31c5fa28bdfabd5fdd9a17c27e4e4ae6f82cdaa8 100644 (file)
@@ -2694,7 +2694,8 @@ AC_SUBST([ws_plugindir])
 # Check for Linux vs. BSD ifreq members
 AC_CHECK_MEMBERS([struct ifreq.ifr_newname,
                   struct ifreq.ifr_ifindex,
-                  struct ifreq.ifr_index],
+                  struct ifreq.ifr_index,
+                  struct ifreq.ifr_hwaddr],
                  [], [],
                  [#include <sys/socket.h>
                   #include <net/if.h>
index 0c9c1f907df02ad8117adf9c0db606c6149b697f..6da3371d550fbf91becc3b43b017d67bc55ab9b4 100644 (file)
@@ -1975,7 +1975,8 @@ virNetDevGetLinkInfo(const char *ifname,
 #endif /* defined(__linux__) */
 
 
-#if defined(SIOCADDMULTI) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCADDMULTI) && defined(HAVE_STRUCT_IFREQ) && \
+    defined(HAVE_STRUCT_IFREQ_IFR_HWADDR)
 /**
  * virNetDevAddMulti:
  * @ifname: interface name to which to add multicast MAC address
@@ -2023,7 +2024,8 @@ int virNetDevAddMulti(const char *ifname ATTRIBUTE_UNUSED,
 }
 #endif
 
-#if defined(SIOCDELMULTI) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCDELMULTI) && defined(HAVE_STRUCT_IFREQ) && \
+    defined(HAVE_STRUCT_IFREQ_IFR_HWADDR)
 /**
  * virNetDevDelMulti:
  * @ifname: interface name from which to delete the multicast MAC address