On 10/29/2014 02:08 PM, Roman Bogorodskiy wrote:
Conrad Meyer wrote:
> Hi all,
>
> The recent commit with SHA1 cc0e8c244d080f56392278e836cc378ba848e7aa,
> "util: Functions to update host network device's multicast filter,"
> breaks the build on FreeBSD, so please address this before 1.2.10
> release.
>
> Here is the output from Clang:
>
> CC util/libvirt_util_la-virnetdev.lo
> util/virnetdev.c:1995:9: error: no member named 'ifr_hwaddr' in 'struct
ifreq'
> ifr.ifr_hwaddr.sa_family = AF_UNSPEC;
> ~~~ ^
> util/virnetdev.c:1996:52: error: no member named 'ifr_hwaddr' in 'struct
ifreq'
> virMacAddrGetRaw(macaddr, (unsigned char *)ifr.ifr_hwaddr.sa_data);
> ~~~ ^
> util/virnetdev.c:2043:9: error: no member named 'ifr_hwaddr' in 'struct
ifreq'
> ifr.ifr_hwaddr.sa_family = AF_UNSPEC;
> ~~~ ^
> util/virnetdev.c:2044:52: error: no member named 'ifr_hwaddr' in 'struct
ifreq'
> virMacAddrGetRaw(macaddr, (unsigned char *)ifr.ifr_hwaddr.sa_data);
> ~~~ ^
> 4 errors generated.
I have fixes for that, will send the patches shortly.
Thank you! I was just going through all that trying to decide a useful
way to resolve it. The new code in question uses similar #if logic to
what was used for virNetDev(Get|Set)MAC(), but those functions (which
also use ifr_hwaddr) use an ioctl that doesn't exist on FreeBSD, so it's
easy. In these new cases, FreeBSD *does* have the ioctl in question, but
apparently implement it in a different way, so something different is
needed in the #if. ifr_hwaddr is a #define on Linux, but I don't know if
that is always guaranteed (or if it could sometimes directly be a member
of the ifreq struct).