Re: [PATCH 1/2] virnetdev: stub virNetDev{Add, Del}Multi on FreeBSD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 10/29/2014 02:20 PM, Roman Bogorodskiy wrote:
> 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         | 3 ++-
>  src/util/virnetdev.c | 6 ++++--
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 

Looks reasonable to me and since it fixes the build on FreeBSD...

ACK

John

I know I did these backwards, but both seem safe for freeze too.
> diff --git a/configure.ac b/configure.ac
> index f7b02ff..31c5fa2 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -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>
> diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
> index 127bfb2..ac82a74 100644
> --- a/src/util/virnetdev.c
> +++ b/src/util/virnetdev.c
> @@ -1971,7 +1971,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
> @@ -2019,7 +2020,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
> 

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]