#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sockio.h>
+#include <net/bpf.h>
#include <ifaddrs.h>
#include <pcap/pcap.h>
#include <net/if.h>
}
ovs_mutex_unlock(&netdev->mutex);
- return 0;
+ return error;
}
static int
ifr_get_flags(const struct ifreq *ifr)
{
#ifdef HAVE_STRUCT_IFREQ_IFR_FLAGSHIGH
- return (ifr->ifr_flagshigh << 16) | ifr->ifr_flags;
+ return (ifr->ifr_flagshigh << 16) | (ifr->ifr_flags & 0xffff);
#else
return ifr->ifr_flags;
#endif
static void
ifr_set_flags(struct ifreq *ifr, int flags)
{
- ifr->ifr_flags = flags;
#ifdef HAVE_STRUCT_IFREQ_IFR_FLAGSHIGH
+ ifr->ifr_flags = flags & 0xffff;
ifr->ifr_flagshigh = flags >> 16;
+#else
+ ifr->ifr_flags = flags;
#endif
}