Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 May 2020 13:12:51 -0700
From:      Cy Schubert <Cy.Schubert@cschubert.com>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        Cy Schubert <cy@freebsd.org>, "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>, freebsd-wireless <freebsd-wireless@freebsd.org>
Subject:   Re: svn commit: r355988 - in head: contrib/libpcap  contrib/libpcap/cmake/Modules contrib/libpcap/doc contrib/libpcap/missing  contrib/libpcap/msdos contrib/libpcap/pcap contrib/libpcap/rpcapd  contrib/li...
Message-ID:  <202005042012.044KCpa4002687@slippy.cwsent.com>
In-Reply-To: <CAJ-VmomJKAW7UrpDR-gmR_OHQJem%2BQgu1i%2BCcLrRgXpNDvmdRA@mail.gmail.com>
References:  <201912212101.xBLL14sr033938@repo.freebsd.org>  <CAJ-VmomJKAW7UrpDR-gmR_OHQJem%2BQgu1i%2BCcLrRgXpNDvmdRA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multipart MIME message.

--==_Exmh_1588623126_39090
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi Adrian,

Looking at our upstream's git repo, can you try the attached patch?

Their commit log message says:

commit 23763c6516cdab2da822101a5aebd6af36122c85
Author: Yi Zhu <Yi.Zhu@Atheros.com>
Date:   Thu Dec 9 11:30:20 2010 -0800

    bsd: Fix receive buffer alignment issue
    
    wpa_supplicant seems to crash from time to time on a NetBSD 4.0 MIPS
    platform. The root cause turned out to be a MIPS alignment issue.
    
    In my wpa_supplicant crash case, in function
    wpa_driver_bsd_event_receive (from driver_bsd.c), the buf[2048] address
    is started from i.e. 0x7fffd546, which is not 4 bytes aligned. Later
    when it is casted to (struct if_msghdr *), and rtm->rtm_flags is used.
    rtm->rtm_flags is "int" type, but its address is not 4 bytes aligned.
    This is because the start address of rtm is not 4 bytes aligned.
    Unfortunately in NetBSD MIPS kernel (unlike Linux MIPS kernel emulates
    unaligned access in its exception handler), the default behavior is to
    generate a memory fault to the application that accesses unaligned
    memory address. Thus comes the early mentioned wpa_supplicant crash. An
    interesting note is when I'm using the wpa_supplicant version 0.4.9, I
    never saw this problem. Maybe the stack layout is different. But I
    didn't look into details.
    
    I used below patch to resolve this problem. Now it runs correctly for at
    least several hours. But you might have a better fix (maybe we can use
    malloc/free so that it is at least cache line aligned?). I'm also not
    sure if other drivers should have the same problem.

Let me know if this fixes your problem.



In message <CAJ-VmomJKAW7UrpDR-gmR_OHQJem+Qgu1i+CcLrRgXpNDvmdRA@mail.gmail.c
om>
, Adrian Chadd writes:
> hi,
>
> This commit /seems/ to have broken things on FreeBSD-HEAD on mips74k.
> I haven't yet tried hostapd mode on x86 with this commit; I"ll do that
> soon.
>
> The TL;DR:
>
> * hostapd + wpa encryption + mips32 (mips74k in this instance) fails
> on -HEAD! Woo!
>
> * l2_packet_freebsd.c in hostapd uses a pcap filter to filter out
> eapol frames from other parties to the eapol/raw receive socket;
> * the filter compilation causes an unaligned access on mips, which i
> /thought/ we handled correctly, but apparently not;
> * the filter as written in hostapd doesn't result in anything being received.
>
> The unaligned warn is:
>
> Unaligned Load Word: pid=426 (tcpdump), tid=100040, pc=0x40569034,
> badvaddr=0x4051d02a
>
> (I dno't yet have the line of code, that's next too.)
>
> The filter is:
>
> *** Filter is "not ether src c4:6e:1f:5b:04:f7 and ( ether dst
> c4:6e:1f:5b:04:f7 or ether dst 01:80:c2:00:00:03 ) and ether proto
> 0x888e"
>
> I'll dig into the details some more soon.
>
> Thanks,
>
>
>
> -adrian
>
>
> On Sat, 21 Dec 2019 at 13:01, Cy Schubert <cy@freebsd.org> wrote:
> >
> > Author: cy
> > Date: Sat Dec 21 21:01:03 2019
> > New Revision: 355988
> > URL: https://svnweb.freebsd.org/changeset/base/355988
> >
> > Log:
> >   MFV r353141 (by phillip):
> >
> >   Update libpcap from 1.9.0 to 1.9.1.
> >
> >   MFC after:    2 weeks
> >
> > Added:
> >   head/contrib/libpcap/CONTRIBUTING.md
> >      - copied unchanged from r353141, vendor/libpcap/dist/CONTRIBUTING.md
> >   head/contrib/libpcap/INSTALL.md
> >      - copied unchanged from r353141, vendor/libpcap/dist/INSTALL.md
> >   head/contrib/libpcap/README.md
> >      - copied unchanged from r353141, vendor/libpcap/dist/README.md
> >   head/contrib/libpcap/doc/
> >      - copied from r353141, vendor/libpcap/dist/doc/
> >   head/contrib/libpcap/missing/asprintf.c
> >      - copied unchanged from r353141, vendor/libpcap/dist/missing/asprintf.
> c
> >   head/contrib/libpcap/missing/strlcat.c
> >      - copied unchanged from r353141, vendor/libpcap/dist/missing/strlcat.c
> >   head/contrib/libpcap/missing/strlcpy.c
> >      - copied unchanged from r353141, vendor/libpcap/dist/missing/strlcpy.c
> >   head/contrib/libpcap/missing/win_asprintf.c
> >      - copied unchanged from r353141, vendor/libpcap/dist/missing/win_aspri
> ntf.c
> >   head/contrib/libpcap/pcap/socket.h
> >      - copied unchanged from r353141, vendor/libpcap/dist/pcap/socket.h
> >   head/contrib/libpcap/pcap_set_immediate_mode.3pcap.in
> >      - copied unchanged from r353141, vendor/libpcap/dist/pcap_set_immediat
> e_mode.3pcap.in
> >   head/contrib/libpcap/pcap_set_protocol_linux.3pcap
> >      - copied unchanged from r353141, vendor/libpcap/dist/pcap_set_protocol
> _linux.3pcap
> >   head/contrib/libpcap/rpcapd/
> >      - copied from r353141, vendor/libpcap/dist/rpcapd/
> >   head/contrib/libpcap/testprogs/
> >      - copied from r353141, vendor/libpcap/dist/testprogs/
> > Deleted:
> >   head/contrib/libpcap/CONTRIBUTING
> >   head/contrib/libpcap/INSTALL.txt
> >   head/contrib/libpcap/README
> >   head/contrib/libpcap/README.Win32
> >   head/contrib/libpcap/README.aix
> >   head/contrib/libpcap/README.dag
> >   head/contrib/libpcap/README.hpux
> >   head/contrib/libpcap/README.linux
> >   head/contrib/libpcap/README.macos
> >   head/contrib/libpcap/README.septel
> >   head/contrib/libpcap/README.sita
> >   head/contrib/libpcap/README.tru64
> >   head/contrib/libpcap/cmake/Modules/FindPthreads-w32.cmake
> >   head/contrib/libpcap/pcap_set_immediate_mode.3pcap
> >   head/contrib/libpcap/pcap_set_protocol.3pcap
> > Modified:
> >   head/contrib/libpcap/CHANGES
> >   head/contrib/libpcap/CMakeLists.txt
> >   head/contrib/libpcap/CREDITS
> >   head/contrib/libpcap/Makefile.in
> >   head/contrib/libpcap/VERSION
> >   head/contrib/libpcap/aclocal.m4
> >   head/contrib/libpcap/bpf_filter.c
> >   head/contrib/libpcap/cmake/Modules/FindPacket.cmake
> >   head/contrib/libpcap/cmakeconfig.h.in
> >   head/contrib/libpcap/config.guess
> >   head/contrib/libpcap/config.h.in
> >   head/contrib/libpcap/config.sub
> >   head/contrib/libpcap/configure
> >   head/contrib/libpcap/configure.ac
> >   head/contrib/libpcap/diag-control.h
> >   head/contrib/libpcap/fmtutils.c
> >   head/contrib/libpcap/fmtutils.h
> >   head/contrib/libpcap/ftmacros.h
> >   head/contrib/libpcap/gencode.c
> >   head/contrib/libpcap/gencode.h
> >   head/contrib/libpcap/grammar.y
> >   head/contrib/libpcap/missing/snprintf.c
> >   head/contrib/libpcap/missing/win_snprintf.c
> >   head/contrib/libpcap/msdos/readme.dos
> >   head/contrib/libpcap/nametoaddr.c
> >   head/contrib/libpcap/optimize.c
> >   head/contrib/libpcap/pcap-bpf.c
> >   head/contrib/libpcap/pcap-bt-linux.c
> >   head/contrib/libpcap/pcap-bt-monitor-linux.c
> >   head/contrib/libpcap/pcap-common.c
> >   head/contrib/libpcap/pcap-common.h
> >   head/contrib/libpcap/pcap-dag.c
> >   head/contrib/libpcap/pcap-dlpi.c
> >   head/contrib/libpcap/pcap-dos.c
> >   head/contrib/libpcap/pcap-filter.manmisc.in
> >   head/contrib/libpcap/pcap-int.h
> >   head/contrib/libpcap/pcap-libdlpi.c
> >   head/contrib/libpcap/pcap-linktype.manmisc.in
> >   head/contrib/libpcap/pcap-linux.c
> >   head/contrib/libpcap/pcap-netfilter-linux.c
> >   head/contrib/libpcap/pcap-netmap.c
> >   head/contrib/libpcap/pcap-new.c
> >   head/contrib/libpcap/pcap-npf.c
> >   head/contrib/libpcap/pcap-null.c
> >   head/contrib/libpcap/pcap-rpcap.c
> >   head/contrib/libpcap/pcap-rpcap.h
> >   head/contrib/libpcap/pcap-savefile.manfile.in
> >   head/contrib/libpcap/pcap-septel.c
> >   head/contrib/libpcap/pcap-sita.c
> >   head/contrib/libpcap/pcap-sita.html
> >   head/contrib/libpcap/pcap-snf.c
> >   head/contrib/libpcap/pcap-tc.c
> >   head/contrib/libpcap/pcap-tstamp.manmisc.in
> >   head/contrib/libpcap/pcap-usb-linux.c
> >   head/contrib/libpcap/pcap.3pcap.in
> >   head/contrib/libpcap/pcap.c
> >   head/contrib/libpcap/pcap/bpf.h
> >   head/contrib/libpcap/pcap/compiler-tests.h
> >   head/contrib/libpcap/pcap/dlt.h
> >   head/contrib/libpcap/pcap/funcattrs.h
> >   head/contrib/libpcap/pcap/nflog.h
> >   head/contrib/libpcap/pcap/pcap-inttypes.h
> >   head/contrib/libpcap/pcap/pcap.h
> >   head/contrib/libpcap/pcap/sll.h
> >   head/contrib/libpcap/pcap_activate.3pcap
> >   head/contrib/libpcap/pcap_breakloop.3pcap
> >   head/contrib/libpcap/pcap_can_set_rfmon.3pcap
> >   head/contrib/libpcap/pcap_compile.3pcap.in
> >   head/contrib/libpcap/pcap_create.3pcap
> >   head/contrib/libpcap/pcap_datalink.3pcap.in
> >   head/contrib/libpcap/pcap_datalink_name_to_val.3pcap
> >   head/contrib/libpcap/pcap_datalink_val_to_name.3pcap
> >   head/contrib/libpcap/pcap_dump.3pcap
> >   head/contrib/libpcap/pcap_dump_file.3pcap
> >   head/contrib/libpcap/pcap_dump_flush.3pcap
> >   head/contrib/libpcap/pcap_dump_ftell.3pcap
> >   head/contrib/libpcap/pcap_dump_open.3pcap.in
> >   head/contrib/libpcap/pcap_file.3pcap
> >   head/contrib/libpcap/pcap_fileno.3pcap
> >   head/contrib/libpcap/pcap_findalldevs.3pcap
> >   head/contrib/libpcap/pcap_freecode.3pcap
> >   head/contrib/libpcap/pcap_get_required_select_timeout.3pcap
> >   head/contrib/libpcap/pcap_get_selectable_fd.3pcap
> >   head/contrib/libpcap/pcap_get_tstamp_precision.3pcap.in
> >   head/contrib/libpcap/pcap_geterr.3pcap
> >   head/contrib/libpcap/pcap_inject.3pcap
> >   head/contrib/libpcap/pcap_is_swapped.3pcap
> >   head/contrib/libpcap/pcap_list_datalinks.3pcap.in
> >   head/contrib/libpcap/pcap_list_tstamp_types.3pcap.in
> >   head/contrib/libpcap/pcap_lookupdev.3pcap
> >   head/contrib/libpcap/pcap_lookupnet.3pcap
> >   head/contrib/libpcap/pcap_loop.3pcap
> >   head/contrib/libpcap/pcap_major_version.3pcap
> >   head/contrib/libpcap/pcap_next_ex.3pcap
> >   head/contrib/libpcap/pcap_offline_filter.3pcap
> >   head/contrib/libpcap/pcap_open_dead.3pcap.in
> >   head/contrib/libpcap/pcap_open_live.3pcap
> >   head/contrib/libpcap/pcap_open_offline.3pcap.in
> >   head/contrib/libpcap/pcap_set_datalink.3pcap
> >   head/contrib/libpcap/pcap_set_timeout.3pcap
> >   head/contrib/libpcap/pcap_set_tstamp_precision.3pcap.in
> >   head/contrib/libpcap/pcap_set_tstamp_type.3pcap.in
> >   head/contrib/libpcap/pcap_setdirection.3pcap
> >   head/contrib/libpcap/pcap_setfilter.3pcap
> >   head/contrib/libpcap/pcap_setnonblock.3pcap
> >   head/contrib/libpcap/pcap_snapshot.3pcap
> >   head/contrib/libpcap/pcap_stats.3pcap
> >   head/contrib/libpcap/pcap_strerror.3pcap
> >   head/contrib/libpcap/pcap_tstamp_type_name_to_val.3pcap
> >   head/contrib/libpcap/pcap_tstamp_type_val_to_name.3pcap
> >   head/contrib/libpcap/portability.h
> >   head/contrib/libpcap/rpcap-protocol.h
> >   head/contrib/libpcap/savefile.c
> >   head/contrib/libpcap/scanner.l
> >   head/contrib/libpcap/sf-pcap.c
> >   head/contrib/libpcap/sf-pcap.h
> >   head/contrib/libpcap/sf-pcapng.c
> >   head/contrib/libpcap/sf-pcapng.h
> >   head/contrib/libpcap/sockutils.c
> >   head/contrib/libpcap/sockutils.h
> >   head/lib/libpcap/Makefile
> >   head/lib/libpcap/config.h
> >   head/sys/net/dlt.h
> > Directory Properties:
> >   head/contrib/libpcap/   (props changed)
> >
> > Modified: head/contrib/libpcap/CHANGES
> > ===========================================================================
> ===
> > --- head/contrib/libpcap/CHANGES        Sat Dec 21 19:23:33 2019        (r3
> 55987)
> > +++ head/contrib/libpcap/CHANGES        Sat Dec 21 21:01:03 2019        (r3
> 55988)
> > @@ -1,5 +1,129 @@
> > -Wednesday, Jan. 25, 2017 guy@alum.mit.edu
> > +Sunday, July 22, 2018
> > +  Summary for 1.9.1 libpcap release
> > +    Mention pcap_get_required_select_timeout() in the main pcap man page
> > +    Fix pcap-usb-linux.c build on systems with musl
> > +    Fix assorted man page and other documentation issues
> > +    Plug assorted memory leaks
> > +    Documentation changes to use https:
> > +    Changes to how time stamp calculations are done
> > +    Lots of tweaks to make newer compilers happier and warning-free and
> > +        to fix instances of C undefined behavior
> > +    Warn if AC_PROG_CC_C99 can't enable C99 support
> > +    Rename pcap_set_protocol() to  pcap_set_protocol_linux().
> > +    Align pcap_t private data on an 8-byte boundary.
> > +    Fix various error messages
> > +    Use 64-bit clean API in dag_findalldevs()
> > +    Fix cleaning up after some errors
> > +    Work around some ethtool ioctl bugs in newer Linux kernels (GitHub
> > +        issue #689)
> > +    Add backwards compatibility sections to some man pages (GitHub issue
> > +        #745)
> > +    Fix autotool configuration on AIX and macOS
> > +    Don't export bpf_filter_with_aux_data() or struct bpf_aux_data;
> > +        they're internal-only and subject to change
> > +    Fix pcapng block size checking
> > +    On macOS, don't build rpcapd or test programs any fatter than they
> > +        need to be
> > +    Fix reading of capture statistics for Linux USB
> > +    Fix packet size values for Linux USB packets (GitHub issue #808)
> > +    Check only VID in VLAN test in filterss (GitHub issue #461)
> > +    Fix pcap_list_datalinks on 802.11 devices on macOS
> > +    Fix overflows with very large snapshot length in pcap file
> > +    Improve parsing of rpcapd configuration file (GitHub issue #767)
> > +    Handle systems without strlcpy() or strlcat() better
> > +    Fix crashes and other errors with invalid filter expressions
> > +    Fix use of uninitialized file descriptor in remote capture
> > +    Fix some CMake issues
> > +    Fix some divide-by-zero issues with the filter compiler
> > +    Work around a GNU libc bug in pcap_nametonetaddr()
> > +    Add support for DLT_LINUX_SLL2
> > +    Fix handling of the packet-count argument for Myricom SNF devices
> > +    Fix --disable-rdma in configure script (GitHub issue #782)
> > +    Fix compilation of TurboCap support (GitHub issue #764)
> > +    Constify first argument to pcap_findalldevs_ex()
> > +    Fix a number of issues when running rpcapd as an inetd-style daemon
> > +    Fix CMake issues with D-Bus libraries
> > +    In rpcapd, clean up termination of a capture session
> > +    Redo remote capture protocol negotiation
> > +    In rpcapd, report the same error for "invalid user name" and
> > +        "invalid password", to make brute-forcing harder
> > +    For remote captures, add an error code for "the server requires TLS"
> > +    Fix pcap_dump_fopen() on Windows to avoid clashes between
> > +        {Win,N}Pcap and application C runtimes
> > +    Fix exporting of functions from Windows DLLs (GitHub issue #810)
> > +    Fix building as part of Npcap
> > +    Allow rpcapd to rebind more rapidly
> > +    Fix building shared libpcap library on midipix (midipix.org)
> > +    Fix hack to detect UTF-16LE adapter names on Windows not to go past
> > +        the end of the string
> > +    Fix handling of "wireless WAN" (mobile phone network modems) on
> > +        Windows with WinPcap/Npcap (GitHub issue #824)
> > +    Have pcap_dump_open_append() create the dump file if it doesn't
> > +        exists (GitHub issue #247)
> > +    Fix the maxmum snapshot length for DLT_USBPCAP
> > +    Use -fPIC when building for 64-bit SPARC on Linux (GitHub issue #837)
> > +    Fix CMake 64-bit library installation directory on some Linux
> > +        distributions
> > +    Boost the TPACKET_V3 timeout to the maximum if a timeout of 0 was
> > +        specified
> > +    Five CVE-2019-15161, CVE-2019-15162, CVE-2019-15163, CVE-2019-15164, C
> VE-2019-15165
> > +    Fixes for CVE-2018-16301, errors in pcapng reading.
> > +    PCAPNG reader applies some sanity checks before doing malloc().
> > +
> > +Sunday, June 24, 2018, by mcr@sandelman.ca
> >    Summary for 1.9.0 libpcap release
> > +    Added testing system to libpcap, independent of tcpdump
> > +    Changes to how pcap_t is activated
> > +    Adding support for Large stream buffers on Endace DAG cards
> > +    Changes to BSD 3-clause license to 2-clause licence
> > +    Additions to TCP header parsing, per RFC3168
> > +    Add CMake build process (extensive number of changes)
> > +    Assign a value for OpenBSD DLT_OPENFLOW.
> > +    Support setting non-blocking mode before activating.
> > +    Extensive build support for Windows VS2010 and MINGW (many many change
> s, over many months)
> > +    Added RPCAPD support when --enable-remote (default no)
> > +    Add the rpcap daemon source and build instructions.
> > +    Put back the greasy "save the capture filter string so we can tweak it
> "
> > +        hack, that keeps libpcap from capturing rpcap traffic.
> > +    Fixes for captures on MacOS, utun0
> > +    fixes so that non-AF_INET addresses, are not ==AF_INET6 addresses.
> > +    Add a linktype for IBM SDLC frames containing SNA PDUs.
> > +    pcap_compile() in 1.8.0 and later is newly thread-safe.
> > +    bound snaplen for linux tpacket_v2 to ~64k
> > +    Make VLAN filter handle both metadata and inline tags
> > +    D-Bus captures can now be up to 128MB in size
> > +    Added LORATAP DLT value
> > +    Added DLT_VSOCK for http://qemu-project.org/Features/VirtioVsock
> > +    probe_devices() fixes not to overrun buffer for name of device
> > +    Add linux-specific pcap_set_protocol_linux() to allow specifying a spe
> cific capture protocol.
> > +    RDMA sniffing support for pcap
> > +    Add Nordic Semiconductor Bluetooth LE sniffer link-layer header type.
> > +    fixes for reading /etc/ethers
> > +    Make it possible to build on Windows without packet.dll.
> > +    Add tests for large file support on UN*X.
> > +    Solaris fixes to work with 2.8.6
> > +    configuration test now looks for header files, not capture devices pre
> sent
> > +    Fix to work with Berkeley YACC.
> > +    fixes for DragonBSD compilation of pcap-netmap.c
> > +    Clean up the ether_hostton() stuff.
> > +    Add an option to disable Linux memory-mapped capture support.
> > +    Add DAG API support checks.
> > +    Add Septel, Myricom SNF, and Riverbed TurboCap checks.
> > +    Add checks for Linux USB, Linux Bluetooth, D-Bus, and RDMA sniffing su
> pport.
> > +    Add a check for hardware time stamping on Linux.
> > +    Don't bother supporting pre-2005 Visual Studio.
> > +    Increased minimum autoconf version requirement to 2.64
> > +    Add DLT value 273 for XRA-31 sniffer
> > +    Clean up handing of signal interrupts in pcap_read_nocb_remote().
> > +    Use the XPG 4.2 versions of the networking APIs in Solaris.
> > +    Fix, and better explain, the "IPv6 means IPv6, not IPv4" option settin
> g.
> > +    Explicitly warn that negative packet buffer timeouts should not be use
> d.
> > +    rpcapd: Add support inetd-likes, including xinetd.conf, and systemd un
> its
> > +    Rename DLT_IEEE802_15_4 to DLT_IEEE802_15_4_WITHFCS.
> > +    Add DISPLAYPORT AUX link type
> > +    Remove the sunos4 kernel modules and all references to them.
> > +    Add more interface flags to pcap_findalldevs().
> > +  Summary for 1.9.0 libpcap release (to 2017-01-25 by guy@alum.mit.edu)
> >      Man page improvements
> >      Fix Linux cooked mode userspace filtering (GitHub pull request #429)
> >      Fix compilation if IPv6 support not enabled
> >
> > Modified: head/contrib/libpcap/CMakeLists.txt
> > ===========================================================================
> ===
> > --- head/contrib/libpcap/CMakeLists.txt Sat Dec 21 19:23:33 2019        (r3
> 55987)
> > +++ head/contrib/libpcap/CMakeLists.txt Sat Dec 21 21:01:03 2019        (r3
> 55988)
> > @@ -9,7 +9,7 @@ if(POLICY CMP0042)
> >      cmake_policy(SET CMP0042 OLD)
> >  endif()
> >
> > -set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
> > +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
> >
> >  project(pcap)
> >
> > @@ -136,83 +136,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
> >  endif()
> >
> >  #
> > -# By default, build universal with the appropriate set of architectures
> > -# for the OS on which we're doing the build.
> > -#
> > -if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
> > -    #
> > -    # Get the major version of Darwin.
> > -    #
> > -    string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MAJOR "${CMAKE_SYSTEM_VE
> RSION}")
> > -
> > -    if(SYSTEM_VERSION_MAJOR LESS 8)
> > -        #
> > -        # Pre-Tiger.  Build only for 32-bit PowerPC.
> > -        #
> > -        set(CMAKE_OSX_ARCHITECTURES "ppc")
> > -    elseif(SYSTEM_VERSION_MAJOR EQUAL 8)
> > -        #
> > -        # Tiger.  Is this prior to, or with, Intel support?
> > -        #
> > -        # Get the minor version of Darwin.
> > -        #
> > -        string(REPLACE "${SYSTEM_VERSION_MAJOR}." "" SYSTEM_MINOR_AND_PATC
> H_VERSION ${CMAKE_SYSTEM_VERSION})
> > -        string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MINOR "${SYSTEM_MINO
> R_AND_PATCH_VERSION}")
> > -        if(SYSTEM_VERSION_MINOR LESS 4)
> > -            #
> > -            # Prior to Intel support.  Build for 32-bit
> > -            # PowerPC and 64-bit PowerPC, with 32-bit PowerPC
> > -            # first.  (I'm guessing that's what Apple does.)
> > -            #
> > -            set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64")
> > -        elseif(SYSTEM_VERSION_MINOR LESS 7)
> > -            #
> > -            # With Intel support but prior to x86-64 support.
> > -            # Build for 32-bit PowerPC, 64-bit PowerPC, and x86,
> > -            # with 32-bit PowerPC first.
> > -            # (I'm guessing that's what Apple does.)
> > -            #
> > -            set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386")
> > -        else()
> > -            #
> > -            # With Intel support including x86-64 support.
> > -            # Build for 32-bit PowerPC, 64-bit PowerPC, x86,
> > -            # and x86-64, with 32-bit PowerPC first.
> > -            # (I'm guessing that's what Apple does.)
> > -            #
> > -            set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386;x86_64")
> > -        endif()
> > -    elseif(SYSTEM_VERSION_MAJOR EQUAL 9)
> > -        #
> > -        # Leopard.  Build for 32-bit PowerPC, 64-bit
> > -        # PowerPC, x86, and x86-64, with 32-bit PowerPC
> > -        # first.  (That's what Apple does.)
> > -        #
> > -        set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386;x86_64")
> > -    elseif(SYSTEM_VERSION_MAJOR EQUAL 10)
> > -        #
> > -        # Snow Leopard.  Build for x86-64, x86, and
> > -        # 32-bit PowerPC, with x86-64 first.  (That's
> > -        # what Apple does, even though Snow Leopard
> > -        # doesn't run on PPC, so PPC libpcap runs under
> > -        # Rosetta, and Rosetta doesn't support BPF
> > -        # ioctls, so PPC programs can't do live
> > -        # captures.)
> > -        #
> > -        set(CMAKE_OSX_ARCHITECTURES "x86_64;i386;ppc")
> > -    else()
> > -        #
> > -        # Post-Snow Leopard.  Build for x86-64 and
> > -        # x86, with x86-64 first.  (That's probably what
> > -        # Apple does, given that Rosetta is gone.)
> > -        # XXX - update if and when Apple drops support
> > -        # for 32-bit x86 code.
> > -        #
> > -        set(CMAKE_OSX_ARCHITECTURES "x86_64;i386")
> > -    endif()
> > -endif()
> > -
> > -#
> >  # Additional capture modules.
> >  #
> >  option(DISABLE_USB "Disable USB sniffing support" OFF)
> > @@ -233,7 +156,7 @@ option(DISABLE_RDMA "Disable RDMA sniffing support" OF
> >  option(DISABLE_DAG "Disable Endace DAG card support" OFF)
> >
> >  option(DISABLE_SEPTEL "Disable Septel card support" OFF)
> > -set(SEPTEL_ROOT "${CMAKE_SOURCE_DIR}/../septel" CACHE PATH "Path to direct
> ory with include and lib subdirectories for Septel API")
> > +set(SEPTEL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../septel" CACHE PATH "Path t
> o directory with include and lib subdirectories for Septel API")
> >
> >  option(DISABLE_SNF "Disable Myricom SNF support" OFF)
> >
> > @@ -251,7 +174,7 @@ option(YYDEBUG "Build parser debugging code" OFF)
> >
> >  # Get, parse, format and set pcap's version string from [pcap_root]/VERSIO
> N
> >  # for later use.
> > -
> > +
> >  # Get MAJOR, MINOR, PATCH & SUFFIX
> >  file(STRINGS ${pcap_SOURCE_DIR}/VERSION
> >      PACKAGE_VERSION
> > @@ -264,7 +187,7 @@ string(REGEX MATCH "^([0-9]+)" PACKAGE_VERSION_MAJOR "
> >  # Get MAJOR, MINOR & PATCH
> >  string(REGEX MATCH "^([0-9]+.)?([0-9]+.)?([0-9]+)" PACKAGE_VERSION_NOSUFFI
> X "${PACKAGE_VERSION}")
> >
> > -if(WIN32)
> > +if(WIN32)
> >      # Convert PCAP_VERSION_NOSUFFIX to Windows preferred version format
> >      string(REPLACE "." "," PACKAGE_VERSION_PREDLL ${PACKAGE_VERSION_NOSUFF
> IX})
> >
> > @@ -289,6 +212,7 @@ include_directories(
> >
> >  include(CheckFunctionExists)
> >  include(CMakePushCheckState)
> > +include(CheckSymbolExists)
> >
> >  if(WIN32)
> >
> > @@ -310,6 +234,14 @@ if(WIN32)
> >          cmake_pop_check_state()
> >      endif(PACKET_FOUND)
> >
> > +    message(STATUS "checking for Npcap's version.h")
> > +    check_symbol_exists(WINPCAP_PRODUCT_NAME "../../version.h" HAVE_VERSIO
> N_H)
> > +    if(HAVE_VERSION_H)
> > +           message(STATUS "HAVE version.h")
> > +    else(HAVE_VERSION_H)
> > +           message(STATUS "MISSING version.h")
> > +    endif(HAVE_VERSION_H)
> > +
> >  endif(WIN32)
> >
> >  if(MSVC)
> > @@ -344,6 +276,11 @@ include(CheckStructHasMember)
> >  include(CheckTypeSize)
> >
> >  #
> > +# Tests are a bit expensive with Visual Studio on Windows, so, on
> > +# Windows, we skip tests for UN*X-only headers and functions.
> > +#
> > +
> > +#
> >  # Header files.
> >  #
> >  check_include_file(inttypes.h HAVE_INTTYPES_H)
> > @@ -395,12 +332,44 @@ endif(NOT WIN32)
> >  #
> >  check_function_exists(strerror HAVE_STRERROR)
> >  check_function_exists(strerror_r HAVE_STRERROR_R)
> > -check_function_exists(strerror_s HAVE_STRERROR_S)
> > +if(HAVE_STRERROR_R)
> > +    #
> > +    # We have strerror_r; if we define _GNU_SOURCE, is it a
> > +    # POSIX-compliant strerror_r() or a GNU strerror_r()?
> > +    #
> > +    check_c_source_compiles(
> > +"#define _GNU_SOURCE
> > +#include <string.h>
> > +
> > +/* Define it GNU-style; that will cause an error if it's not GNU-style */
> > +extern char *strerror_r(int, char *, size_t);
> > +
> > +int
> > +main(void)
> > +{
> > +       return 0;
> > +}
> > +"
> > +            HAVE_GNU_STRERROR_R)
> > +    if(NOT HAVE_GNU_STRERROR_R)
> > +        set(HAVE_POSIX_STRERROR_R YES)
> > +    endif(NOT HAVE_GNU_STRERROR_R)
> > +else(HAVE_STRERROR_R)
> > +    #
> > +    # We don't have strerror_r; do we have strerror_s?
> > +    #
> > +    check_function_exists(strerror_s HAVE_STRERROR_S)
> > +endif(HAVE_STRERROR_R)
> >  check_function_exists(strlcpy HAVE_STRLCPY)
> >  check_function_exists(strlcat HAVE_STRLCAT)
> >  check_function_exists(snprintf HAVE_SNPRINTF)
> >  check_function_exists(vsnprintf HAVE_VSNPRINTF)
> > +check_function_exists(asprintf HAVE_ASPRINTF)
> > +check_function_exists(vasprintf HAVE_VASPRINTF)
> >  check_function_exists(strtok_r HAVE_STRTOK_R)
> > +if(NOT WIN32)
> > +    check_function_exists(vsyslog HAVE_VSYSLOG)
> > +endif()
> >
> >  #
> >  # These tests are for network applications that need socket functions
> > @@ -429,7 +398,6 @@ check_function_exists(strtok_r HAVE_STRTOK_R)
> >  #
> >  set(PCAP_LINK_LIBRARIES "")
> >  include(CheckLibraryExists)
> > -include(CheckSymbolExists)
> >  if(WIN32)
> >      #
> >      # We need winsock2.h and ws2tcpip.h.
> > @@ -865,11 +833,61 @@ set(PROJECT_SOURCE_LIST_C
> >  )
> >
> >  if(WIN32)
> > -    set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/win_snprint
> f.c)
> > +    #
> > +    # For now, we assume we don't have snprintf() or that it's not one
> > +    # that behaves enough like C99's snprintf() for our purposes (i.e.,
> > +    # it doesn't null-terminate the string if it truncates it to fit in
> > +    # the buffer), so we have to provide our own (a wrapper around
> > +    # _snprintf() that null-terminates the buffer).
> > +    #
> > +    # We also assume we don't have asprintf(), and provide an implementati
> on
> > +    # that uses _vscprintf() to determine how big the string needs to be.
> > +    #
> > +    set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C}
> > +        missing/win_snprintf.c missing/win_asprintf.c)
> >  else()
> > +    #
> > +    # Either:
> > +    #
> > +    #  we have snprintf() and vsnprintf(), and have asprintf() and
> > +    #  vasprintf();
> > +    #
> > +    #  we have snprintf() and vsnprintf(), but don't have asprintf()
> > +    #  or vasprintf();
> > +    #
> > +    #  we have neither snprintf() nor vsnprintf(), and don't have
> > +    #  asprintf() or vasprintf(), either.
> > +    #
> > +    # We assume that if we have asprintf() we have vasprintf(), as well
> > +    # as snprintf() and vsnprintf(), and that if we have snprintf() we
> > +    # have vsnprintf().
> > +    #
> > +    # For the first case, we don't need any replacement routines.
> > +    # For the second case, we need replacement asprintf()/vasprintf()
> > +    # routines.
> > +    # For the third case, we need replacement snprintf()/vsnprintf() and
> > +    # asprintf()/vasprintf() routines.
> > +    #
> >      if(NOT HAVE_SNPRINTF)
> > +        #
> > +        # We assume we have none of them; missing/snprintf.c supplies
> > +        # all of them.
> > +        #
> >          set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/snprint
> f.c)
> > -    endif(NOT HAVE_SNPRINTF)
> > +    elif(NOT HAVE_ASPRINTF)
> > +        #
> > +        # We assume we have snprintf()/vsnprintf() but lack
> > +        # asprintf()/vasprintf(); missing/asprintf.c supplies
> > +        # the latter (using vsnprintf()).
> > +        #
> > +        set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/asprint
> f.c)
> > +    endif()
> > +    if(NOT HAVE_STRLCAT)
> > +        set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/strlcat
> .c)
> > +    endif(NOT HAVE_STRLCAT)
> > +    if(NOT HAVE_STRLCPY)
> > +        set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/strlcpy
> .c)
> > +    endif(NOT HAVE_STRLCPY)
> >      if(NOT HAVE_STRTOK_R)
> >          set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/strtok_
> r.c)
> >      endif(NOT HAVE_STRTOK_R)
> > @@ -931,13 +949,16 @@ else()
> >              # as it's a Linux, it should use packet sockets,
> >              # instead.
> >              #
> > -            #
> >              # We need:
> >              #
> >              #  sys/types.h, because FreeBSD 10's net/bpf.h
> >              #  requires that various BSD-style integer types
> >              #  be defined;
> >              #
> > +            #  sys/time.h, because AIX 5.2 and 5.3's net/bpf.h
> > +            #  doesn't include it but does use struct timeval
> > +            #  in ioctl definitions;
> > +            #
> >              #  sys/ioctl.h and, if we have it, sys/ioccom.h,
> >              #  because net/bpf.h defines ioctls;
> >              #
> > @@ -952,9 +973,9 @@ else()
> >              # of those headers itself.
> >              #
> >              if(HAVE_SYS_IOCCOM_H)
> > -                check_symbol_exists(BIOCSETIF "sys/types.h;sys/ioctl.h;sys
> /socket.h;sys/ioccom.h;net/bpf.h;net/if.h" BPF_H_DEFINES_BIOCSETIF)
> > +                check_symbol_exists(BIOCSETIF "sys/types.h;sys/time.h;sys/
> ioctl.h;sys/socket.h;sys/ioccom.h;net/bpf.h;net/if.h" BPF_H_DEFINES_BIOCSETIF
> )
> >              else(HAVE_SYS_IOCCOM_H)
> > -                check_symbol_exists(BIOCSETIF "sys/types.h;sys/ioctl.h;sys
> /socket.h;net/bpf.h;net/if.h" BPF_H_DEFINES_BIOCSETIF)
> > +                check_symbol_exists(BIOCSETIF "sys/types.h;sys/time.h;sys/
> ioctl.h;sys/socket.h;net/bpf.h;net/if.h" BPF_H_DEFINES_BIOCSETIF)
> >              endif(HAVE_SYS_IOCCOM_H)
> >          endif(HAVE_NET_BPF_H)
> >          check_include_file(net/pfilt.h HAVE_NET_PFILT_H)
> > @@ -1436,7 +1457,28 @@ if(NOT DISABLE_DBUS)
> >          set(PCAP_SUPPORT_DBUS TRUE)
> >          set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} pcap-dbus.c)
> >          include_directories(${DBUS_INCLUDE_DIRS})
> > -        set(PCAP_LINK_LIBRARIES ${PCAP_LINK_LIBRARIES} ${DBUS_LIBRARIES})
> > +
> > +        #
> > +        # This "helpfully" supplies DBUS_LIBRARIES as a bunch of
> > +        # library names - not paths - and DBUS_LIBRARY_DIRS as
> > +        # a bunch of directories.
> > +        #
> > +        # CMake *really* doesn't like the notion of specifying "here are
> > +        # the directories in which to look for libraries" except in
> > +        # find_library() calls; it *really* prefers using full paths to
> > +        # library files, rather than library names.
> > +        #
> > +        # Find the libraries and add their full paths.
> > +        #
> > +        set(DBUS_LIBRARY_FULLPATHS)
> > +        foreach(_lib IN LISTS DBUS_LIBRARIES)
> > +            #
> > +            # Try to find this library, so we get its full path.
> > +            #
> > +            find_library(_libfullpath ${_lib} HINTS ${DBUS_LIBRARY_DIRS})
> > +            list(APPEND DBUS_LIBRARY_FULLPATHS ${_libfullpath})
> > +        endforeach()
> > +        set(PCAP_LINK_LIBRARIES ${PCAP_LINK_LIBRARIES} ${DBUS_LIBRARY_FULL
> PATHS})
> >      endif(DBUS_FOUND)
> >  endif(NOT DISABLE_DBUS)
> >
> > @@ -1499,7 +1541,7 @@ if(NOT DISABLE_DAG)
> >              endif()
> >          endif()
> >      endif()
> > -endif()
> > +endif()
> >
> >  # Check for Septel card support.
> >  set(PROJECT_EXTERNAL_OBJECT_LIST "")
> > @@ -1521,7 +1563,7 @@ if(NOT DISABLE_SEPTEL)
> >          set(PROJECT_EXTERNAL_OBJECT_LIST ${PROJECT_EXTERNAL_OBJECT_LIST} "
> ${SEPTEL_ROOT}/asciibin.o ${SEPTEL_ROOT}/bit2byte.o ${SEPTEL_ROOT}/confirm.o 
> ${SEPTEL_ROOT}/fmtmsg.o ${SEPTEL_ROOT}/gct_unix.o ${SEPTEL_ROOT}/hqueue.o ${S
> EPTEL_ROOT}/ident.o ${SEPTEL_ROOT}/mem.o ${SEPTEL_ROOT}/pack.o ${SEPTEL_ROOT}
> /parse.o ${SEPTEL_ROOT}/pool.o ${SEPTEL_ROOT}/sdlsig.o ${SEPTEL_ROOT}/strtonu
> m.o ${SEPTEL_ROOT}/timer.o ${SEPTEL_ROOT}/trace.o")
> >          set(HAVE_SEPTEL_API TRUE)
> >      endif()
> > -endif()
> > +endif()
> >
> >  # Check for Myricom SNF support.
> >  if(NOT DISABLE_SNF)
> > @@ -1542,7 +1584,7 @@ if(NOT DISABLE_SNF)
> >          set(HAVE_SNF_API TRUE)
> >          set(PCAP_LINK_LIBRARIES ${PCAP_LINK_LIBRARIES} ${SNF_LIBRARIES})
> >      endif()
> > -endif()
> > +endif()
> >
> >  # Check for Riverbed TurboCap support.
> >  if(NOT DISABLE_TC)
> > @@ -1563,7 +1605,7 @@ if(NOT DISABLE_TC)
> >          set(HAVE_TC_API TRUE)
> >          set(PCAP_LINK_LIBRARIES "${PCAP_LINK_LIBRARIES} ${TC_LIBRARIES} ${
> CMAKE_USE_PTHREADS_INIT} stdc++")
> >      endif()
> > -endif()
> > +endif()
> >
> >  #
> >  # Remote capture support.
> > @@ -1582,7 +1624,7 @@ if(ENABLE_REMOTE)
> >      # the check.
> >      #
> >      cmake_push_check_state()
> > -    set(CMAKE_REQUIRED_INCLUDES ${CMAKE_SOURCE_DIR})
> > +    set(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR})
> >      check_struct_has_member("struct msghdr" msg_control "ftmacros.h;sys/so
> cket.h" HAVE_STRUCT_MSGHDR_MSG_CONTROL)
> >      check_struct_has_member("struct msghdr" msg_flags "ftmacros.h;sys/sock
> et.h" HAVE_STRUCT_MSGHDR_MSG_FLAGS)
> >      cmake_pop_check_state()
> > @@ -1597,7 +1639,7 @@ endif(ENABLE_REMOTE)
> >  #
> >  # Check and add warning options if we have a .devel file.
> >  #
> > -if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel)
> > +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}
> /.devel)
> >      #
> >      # Warning options.
> >      #
> > @@ -1808,10 +1850,12 @@ set_source_files_properties(${CMAKE_CURRENT_BINARY_
> DIR
> >
> >  #
> >  # Assume, by default, no support for shared libraries and V7/BSD
> > -# convention for man pages (file formats in section 5, miscellaneous
> > -# info in section 7, administrative commands and daemons in section 8).
> > +# convention for man pages (devices in section 4, file formats in
> > +# section 5, miscellaneous info in section 7, administrative commands
> > +# and daemons in section 8).  Individual cases can override this.
> >  # Individual cases can override this.
> >  #
> > +set(MAN_DEVICES 4)
> >  set(MAN_FILE_FORMATS 5)
> >  set(MAN_MISC_INFO 7)
> >  set(MAN_ADMIN_COMMANDS 8)
> > @@ -1869,6 +1913,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "OSF1")
> >      #
> >      set(MAN_FILE_FORMATS 4)
> >      set(MAN_MISC_INFO 5)
> > +    set(MAN_DEVICES 7)
> >  elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES
>  "5[.][0-9.]*")
> >      #
> >      # SunOS 5.x.
> > @@ -1892,6 +1937,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_S
> Y
> >          set(MAN_ADMIN_COMMANDS 1m)
> >          set(MAN_FILE_FORMATS 4)
> >          set(MAN_MISC_INFO 5)
> > +        set(MAN_DEVICES 7D)
> >      endif()
> >  endif()
> >
> > @@ -1944,6 +1990,16 @@ if(BUILD_SHARED_LIBS)
> >      add_dependencies(${LIBRARY_NAME} SerializeTarget)
> >      set_target_properties(${LIBRARY_NAME} PROPERTIES
> >          COMPILE_DEFINITIONS BUILDING_PCAP)
> > +    #
> > +    # No matter what the library is called - it might be called "wpcap"
> > +    # in a Windows build - the symbol to define to indicate that we're
> > +    # building the library, rather than a program using the library,
> > +    # and thus that we're exporting functions defined in our public
> > +    # header files, rather than importing those functions, is
> > +    # pcap_EXPORTS.
> > +    #
> > +    set_target_properties(${LIBRARY_NAME} PROPERTIES
> > +        DEFINE_SYMBOL pcap_EXPORTS)
> >  endif(BUILD_SHARED_LIBS)
> >
> >  add_library(${LIBRARY_NAME}_static STATIC
> > @@ -1982,7 +2038,7 @@ if(WIN32)
> >          # For compatibility, build the shared library without the "lib" pr
> efix on
> >          # MinGW as well.
> >          #
> > -        set_target_properties(${LIBRARY_NAME} PROPERTIES
> > +        set_target_properties(${LIBRARY_NAME} PROPERTIES
> >              PREFIX ""
> >              OUTPUT_NAME "${LIBRARY_NAME}"
> >          )
> > @@ -2020,6 +2076,118 @@ if(NOT C_ADDITIONAL_FLAGS STREQUAL "")
> >      set_target_properties(${LIBRARY_NAME}_static PROPERTIES COMPILE_FLAGS 
> ${C_ADDITIONAL_FLAGS})
> >  endif()
> >
> > +#
> > +# On macOS, build libpcap for the appropriate architectures, if
> > +# CMAKE_OSX_ARCHITECTURES isn't set (if it is, let that control
> > +# the architectures for which to build it).
> > +#
> > +if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
> > +    #
> > +    # Get the major version of Darwin.
> > +    #
> > +    string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MAJOR "${CMAKE_SYSTEM_VE
> RSION}")
> > +
> > +    if(SYSTEM_VERSION_MAJOR LESS 8)
> > +        #
> > +        # Pre-Tiger.  Build only for 32-bit PowerPC.
> > +        #
> > +        set(OSX_LIBRARY_ARCHITECTURES "ppc")
> > +    elseif(SYSTEM_VERSION_MAJOR EQUAL 8)
> > +        #
> > +        # Tiger.  Is this prior to, or with, Intel support?
> > +        #
> > +        # Get the minor version of Darwin.
> > +        #
> > +        string(REPLACE "${SYSTEM_VERSION_MAJOR}." "" SYSTEM_MINOR_AND_PATC
> H_VERSION ${CMAKE_SYSTEM_VERSION})
> > +        string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MINOR "${SYSTEM_MINO
> R_AND_PATCH_VERSION}")
> > +        if(SYSTEM_VERSION_MINOR LESS 4)
> > +            #
> > +            # Prior to Intel support.  Build for 32-bit
> > +            # PowerPC and 64-bit PowerPC, with 32-bit PowerPC
> > +            # first.  (I'm guessing that's what Apple does.)
> > +            #
> > +            set(OSX_LIBRARY_ARCHITECTURES "ppc;ppc64")
> > +        elseif(SYSTEM_VERSION_MINOR LESS 7)
> > +            #
> > +            # With Intel support but prior to x86-64 support.
> > +            # Build for 32-bit PowerPC, 64-bit PowerPC, and 32-bit x86,
> > +            # with 32-bit PowerPC first.
> > +            # (I'm guessing that's what Apple does.)
> > +            #
> > +            set(OSX_LIBRARY_ARCHITECTURES "ppc;ppc64;i386")
> > +        else()
> > +            #
> > +            # With Intel support including x86-64 support.
> > +            # Build for 32-bit PowerPC, 64-bit PowerPC, 32-bit x86,
> > +            # and x86-64, with 32-bit PowerPC first.
> > +            # (I'm guessing that's what Apple does.)
> > +            #
> > +            set(OSX_LIBRARY_ARCHITECTURES "ppc;ppc64;i386;x86_64")
> > +        endif()
> > +    elseif(SYSTEM_VERSION_MAJOR EQUAL 9)
> > +        #
> > +        # Leopard.  Build for 32-bit PowerPC, 64-bit
> > +        # PowerPC, 32-bit x86, and x86-64, with 32-bit PowerPC
> > +        # first.  (That's what Apple does.)
> > +        #
> > +        set(OSX_LIBRARY_ARCHITECTURES "ppc;ppc64;i386;x86_64")
> > +    elseif(SYSTEM_VERSION_MAJOR EQUAL 10)
> > +        #
> > +        # Snow Leopard.  Build for x86-64, 32-bit x86, and
> > +        # 32-bit PowerPC, with x86-64 first.  (That's
> > +        # what Apple does, even though Snow Leopard
> > +        # doesn't run on PPC, so PPC libpcap runs under
> > +        # Rosetta, and Rosetta doesn't support BPF
> > +        # ioctls, so PPC programs can't do live
> > +        # captures.)
> > +        #
> > +        set(OSX_LIBRARY_ARCHITECTURES "x86_64;i386;ppc")
> > +    else()
> > +        #
> > +        # Post-Snow Leopard.  Build for x86-64 and 32-bit x86,
> > +        # with x86-64 first.  (That's what Apple does)
> > +        # XXX - update if and when Apple drops support
> > +        # for 32-bit x86 code and if and when Apple adds
> > +        # ARM-based Macs.  (You're on your own for iOS etc.)
> > +        #
> > +        # XXX - check whether we *can* build for i386 and, if not,
> > +        # suggest that the user install the /usr/include headers if
> > +        # they want to build fat.
> > +        #
> > +        cmake_push_check_state()
> > +        set(CMAKE_REQUIRED_FLAGS "-arch i386")
> > +        check_c_source_compiles(
> > +"int
> > +main(void)
> > +{
> > +    return 0;
> > +}
> > +"
> > +                   X86_32_BIT_SUPPORTED)
> > +        cmake_pop_check_state()
> > +        if(X86_32_BIT_SUPPORTED)
> > +            set(OSX_LIBRARY_ARCHITECTURES "x86_64;i386")
> > +        else()
> > +            set(OSX_LIBRARY_ARCHITECTURES "x86_64")
> > +            if(SYSTEM_VERSION_MAJOR LESS 18)
> > +                #
> > +                # Pre-Mojave; the command-line tools should be sufficient 
> to
> > +                # enable 32-bit x86 builds.
> > +                #
> > +                message(WARNING "Compiling for 32-bit x86 gives an error; 
> try installing the command-line tools")
> > +            else()
> > +                message(WARNING "Compiling for 32-bit x86 gives an error; 
> try installing the command-line tools and, after that, installing the /usr/in
> clude headers from the /Library/Developer/CommandLineTools/Packages/macOS_SDK
> _headers_for_macOS_10.14.pkg package")
> > +            endif()
> > +        endif()
> > +    endif()
> > +    if(BUILD_SHARED_LIBS)
> > +        set_target_properties(${LIBRARY_NAME} PROPERTIES
> > +            OSX_ARCHITECTURES "${OSX_LIBRARY_ARCHITECTURES}")
> > +    endif(BUILD_SHARED_LIBS)
> > +    set_target_properties(${LIBRARY_NAME}_static PROPERTIES
> > +        OSX_ARCHITECTURES "${OSX_LIBRARY_ARCHITECTURES}")
> > +endif()
> > +
> >  ######################################
> >  # Write out the config.h file
> >  ######################################
> > @@ -2079,6 +2247,7 @@ set(MAN3PCAP_EXPAND
> >      pcap_list_tstamp_types.3pcap.in
> >      pcap_open_dead.3pcap.in
> >      pcap_open_offline.3pcap.in
> > +    pcap_set_immediate_mode.3pcap.in
> >      pcap_set_tstamp_precision.3pcap.in
> >      pcap_set_tstamp_type.3pcap.in
> >  )
> > @@ -2114,9 +2283,8 @@ set(MAN3PCAP_NOEXPAND
> >      pcap_open_live.3pcap
> >      pcap_set_buffer_size.3pcap
> >      pcap_set_datalink.3pcap
> > -    pcap_set_immediate_mode.3pcap
> >      pcap_set_promisc.3pcap
> > -    pcap_set_protocol.3pcap
> > +    pcap_set_protocol_linux.3pcap
> >      pcap_set_rfmon.3pcap
> >      pcap_set_snaplen.3pcap
> >      pcap_set_timeout.3pcap
> > @@ -2179,11 +2347,13 @@ if(WIN32)
> >          endif(NOT MINGW)
> >      endif(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
> >  else(WIN32)
> > -    install(TARGETS ${LIBRARY_NAME} ${LIBRARY_NAME_STATIC} DESTINATION lib
> )
> > +    install(TARGETS ${LIBRARY_NAME} ${LIBRARY_NAME_STATIC} DESTINATION ${C
> MAKE_INSTALL_FULL_LIBDIR})
> >  endif(WIN32)
> >
> >  install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/pcap/ DESTINATION include/pc
> ap)
> >  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap.h DESTINATION include)
> > +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-bpf.h DESTINATION include)
> > +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-namedb.h DESTINATION includ
> e)
> >
> >  # On UN*X, and on Windows when not using MSVC, generate libpcap.pc and
> >  # pcap-config and process man pages and arrange that they be installed.
> > @@ -2223,8 +2393,8 @@ if(NOT MSVC)
> >      foreach(LIB ${PCAP_LINK_LIBRARIES})
> >          set(LIBS "${LIBS} -l${LIB}")
> >      endforeach(LIB)
> > -    configure_file(${CMAKE_SOURCE_DIR}/pcap-config.in ${CMAKE_CURRENT_BINA
> RY_DIR}/pcap-config @ONLY)
> > -    configure_file(${CMAKE_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINAR
> Y_DIR}/libpcap.pc @ONLY)
> > +    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcap-config.in ${CMAKE_CURR
> ENT_BINARY_DIR}/pcap-config @ONLY)
> > +    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRE
> NT_BINARY_DIR}/libpcap.pc @ONLY)
> >      install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pcap-config DESTINATION b
> in)
> >      install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/p
> kgconfig)
> >
> > @@ -2236,17 +2406,17 @@ if(NOT MSVC)
> >      #
> >      set(MAN1 "")
> >      foreach(MANPAGE ${MAN1_NOEXPAND})
> > -        set(MAN1 ${MAN1} ${CMAKE_SOURCE_DIR}/${MANPAGE})
> > +        set(MAN1 ${MAN1} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE})
> >      endforeach(MANPAGE)
> >      install(FILES ${MAN1} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
> >
> >      set(MAN3PCAP "")
> >      foreach(MANPAGE ${MAN3PCAP_NOEXPAND})
> > -        set(MAN3PCAP ${MAN3PCAP} ${CMAKE_SOURCE_DIR}/${MANPAGE})
> > +        set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE})
> >      endforeach(MANPAGE)
> >      foreach(TEMPLATE_MANPAGE ${MAN3PCAP_EXPAND})
> >          string(REPLACE ".in" "" MANPAGE ${TEMPLATE_MANPAGE})
> > -        configure_file(${CMAKE_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CUR
> RENT_BINARY_DIR}/${MANPAGE} @ONLY)
> > +        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${C
> MAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
> >          set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
> >      endforeach(TEMPLATE_MANPAGE)
> >      install(FILES ${MAN3PCAP} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
> > @@ -2270,7 +2440,7 @@ if(NOT MSVC)
> >      set(MANFILE "")
> >      foreach(TEMPLATE_MANPAGE ${MANFILE_EXPAND})
> >          string(REPLACE ".manfile.in" ".${MAN_FILE_FORMATS}" MANPAGE ${TEMP
> LATE_MANPAGE})
> > -        configure_file(${CMAKE_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CUR
> RENT_BINARY_DIR}/${MANPAGE} @ONLY)
> > +        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${C
> MAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
> >          set(MANFILE ${MANFILE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
> >      endforeach(TEMPLATE_MANPAGE)
> >      install(FILES ${MANFILE} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_
> FILE_FORMATS})
> > @@ -2278,7 +2448,7 @@ if(NOT MSVC)
> >      set(MANMISC "")
> >      foreach(TEMPLATE_MANPAGE ${MANMISC_EXPAND})
> >          string(REPLACE ".manmisc.in" ".${MAN_MISC_INFO}" MANPAGE ${TEMPLAT
> E_MANPAGE})
> > -        configure_file(${CMAKE_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CUR
> RENT_BINARY_DIR}/${MANPAGE} @ONLY)
> > +        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${C
> MAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
> >          set(MANMISC ${MANMISC} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
> >      endforeach(TEMPLATE_MANPAGE)
> >      install(FILES ${MANMISC} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_
> MISC_INFO})
> >
> > Copied: head/contrib/libpcap/CONTRIBUTING.md (from r353141, vendor/libpcap/
> dist/CONTRIBUTING.md)
> > ===========================================================================
> ===
> > --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> > +++ head/contrib/libpcap/CONTRIBUTING.md        Sat Dec 21 21:01:03 2019   
>      (r355988, copy of r353141, vendor/libpcap/dist/CONTRIBUTING.md)
> > @@ -0,0 +1,29 @@
> > +Guidelines for contributing
> > +===========================
> > +
> > +To report a security issue (segfault, buffer overflow, infinite loop, arbi
> trary
> > +code execution etc) please send an e-mail to security@tcpdump.org, do not 
> use
> > +the bug tracker!
> > +
> > +To report a non-security problem (failure to compile, failure to capture p
> ackets
> > +properly, missing support for a network interface type or DLT) please chec
> k
> > +first that it reproduces with the latest stable release of libpcap. If it 
> does,
> > +please check that the problem reproduces with the current git master branc
> h of
> > +libpcap. If it does (and it is not a security-related problem, otherwise s
> ee
> > +above), please navigate to https://github.com/the-tcpdump-group/libpcap/is
> sues
> > +and check if the problem has already been reported. If it has not, please 
> open
> > +a new issue and provide the following details:
> > +
> > +* libpcap version (e.g. from tcpdump --version)
> > +* operating system name and version and any other details that may be rele
> vant
> > +  (uname -a, compiler name and version, CPU type etc.)
> > +* configure flags if any were used
> > +* statement of the problem
> > +* steps to reproduce
> > +
> > +Please note that if you know exactly how to solve the problem and the solu
> tion
> > +would not be too intrusive, it would be best to contribute some developmen
> t time
> > +and open a pull request instead.
> > +
> > +Still not sure how to do? Feel free to [subscribe](https://www.tcpdump.org
> /#mailing-lists)
> > +to the mailing list tcpdump-workers@lists.tcpdump.org and ask!
> >
> > Modified: head/contrib/libpcap/CREDITS
> > ===========================================================================
> ===
> > --- head/contrib/libpcap/CREDITS        Sat Dec 21 19:23:33 2019        (r3
> 55987)
> > +++ head/contrib/libpcap/CREDITS        Sat Dec 21 21:01:03 2019        (r3
> 55988)
> > @@ -1,21 +1,18 @@
> > -This file lists people who have contributed to libpcap:
> > +This file lists people who have contributed to libpcap.
> >
> > -The current maintainers:
> > -    Bill Fenner                   <fenner at research dot att dot com>
> > +The current maintainers (in alphabetical order):
> >      Denis Ovsienko                <denis at ovsienko dot info>
> > -    Fulvio Risso                  <risso at polito dot it>
> > +    Francois-Xavier Le Bail       <devel dot fx dot lebail at orange dot f
> r>
> >      Guy Harris                    <guy at alum dot mit dot edu>
> > -    Hannes Gredler                <hannes at juniper dot net>
> >      Michael Richardson            <mcr at sandelman dot ottawa dot on dot 
> ca>
> > -    Francois-Xavier Le Bail       <fx dot lebail at yahoo dot com>
> >
> > -Additional people who have contributed patches:
> > -
> > +Additional people who have contributed patches (in alphabetical order):
> >      Akos Vandra                   <axos88 at gmail dot com>
> >      Alan Bawden                   <Alan at LCS dot MIT dot EDU>
> >      Albert Chin                   <china at thewrittenword dot com>
> >      Alexander 'Leo' Bergolth      <Leo dot Bergolth at wu-wien dot ac dot 
> at>
> >      Alexey Kuznetsov              <kuznet at ms2 dot inr dot ac dot ru>
> > +    Ali Abdulkadir                <autostart dot ini at gmail dot com>
> >      Alon Bar-Lev                  <alonbl at sourceforge dot net>
> >      Andres Perera                 <andres dot p at zoho dot com>
> >      Andrew Brown                  <atatat at atatdot dot net>
> > @@ -62,6 +59,7 @@ Additional people who have contributed patches:
> >      Gabor Tatarka                 <gabor dot tatarka at ericsson dot com>
> >      Garrett Cooper                <yaberauneya at sourceforge dot net>
> >      George Neville-Neil           <gnn at freebsd dot org>
> > +    Gerard Garcia                 <nouboh at gmail dot com>
> >      Gianluca Varenni              <gianluca dot varenni at gmail dot com>
> >      Gilbert Hoyek                 <gil_hoyek at hotmail dot com>
> >      Gisle Vanem                   <gvanem at yahoo dot no>
> > @@ -99,6 +97,7 @@ Additional people who have contributed patches:
> >      Koryn Grant                   <koryn at endace dot com>
> >      Kris Katterjohn               <katterjohn at gmail dot com>
> >      Krzysztof Halasa              <khc at pm dot waw dot pl>
> > +    Lennert Buytenhek             <buytenh at wantstofly dot org>
> >      Lorenzo Cavallaro             <sullivan at sikurezza dot org>
> >      Loris Degioanni               <loris at netgroup-serv dot polito dot i
> t>
> >      Love Hörnquist-Åstrand        <lha at stacken dot kth dot se>
> > @@ -114,6 +113,7 @@ Additional people who have contributed patches:
> >      Márton Németh                 <nm127 at freemail dot hu>
> >      Matthew Luckie                <mjl at luckie dot org dot nz>
> >      Max Laier                     <max at love2party dot net>
> > +    Michal Kubecek                <mkubecek at suse dot cz>
> >      Michal Labedzki               <michal dot labedzki at tieto dot com>
> >      Michal Sekletar               <msekleta at redhat dot com>
> >      Mike Frysinger                <vapier at gmail dot com>
> > @@ -129,7 +129,7 @@ Additional people who have contributed patches:
> >      Olaf Kirch                    <okir at caldera dot de>
> >      Ollie Wild                    <aaw at users dot sourceforge dot net>
> >      Onno van der Linden           <onno at simplex dot nl>
> > -    Paolo Abeni                   <paolo dot abeni at email dot it>
> > +    Paolo Abeni                   <pabeni at redhat dot com>
> >      Patrick Marie                 <mycroft at virgaria dot org>
> >      Patrick McHardy               <kaber at trash not net>
> >      Paul Mundt                    <lethal at linux-sh dot org>
> > @@ -145,6 +145,8 @@ Additional people who have contributed patches:
> >      Rick Jones                    <raj at cup dot hp dot com>
> >      Robert Edmonds                <stu-42 at sourceforge dot net>
> >      Roberto Mariani               <jelot-tcpdump at jelot dot it>
> > +    Rongxi Li                     <rongxi dot li at chaitin dot com>
> > +    Roland Dreier                 <roland at purestorage dot com>
> >      Romain Francoise              <rfrancoise at debian dot org>
> >      Sagun Shakya                  <sagun dot shakya at sun dot com>
> >      Scott Barron                  <sb125499 at ohiou dot edu>
> > @@ -167,6 +169,7 @@ Additional people who have contributed patches:
> >      Wesley Shields                <wxs at FreeBSD dot org>
> >      Xianjie Zhang                 <xzhang at cup dot hp dot com>
> >      Xin Li                        <delphij at FreeBSD dot org>
> > +    Xue Jiang Qing                <xuejianqing at star-net dot cn>
> >      Yen Yen Lim
> >      Yoann Vandoorselaere          <yoann at prelude-ids dot org>
> >      Yvan Vanhullebus              <vanhu at sourceforge dot net>
> > @@ -176,5 +179,8 @@ The original LBL crew:
> >      Craig Leres
> >      Van Jacobson
> >
> > -Past maintainers:
> > -    Jun-ichiro itojun Hagino         <itojun at iijlab dot net>           
>      Also see: http://www.wide.ad.jp/itojun-award/
> > +Past maintainers (in alphabetical order):
> > +    Bill Fenner                   <fenner at research dot att dot com>
> > +    Fulvio Risso                  <risso at polito dot it>
> > +    Hannes Gredler                <hannes at gredler dot at>
> > +    Jun-ichiro itojun Hagino      <itojun at iijlab dot net>           Als
> o see: http://www.wide.ad.jp/itojun-award/
> >
> > Copied: head/contrib/libpcap/INSTALL.md (from r353141, vendor/libpcap/dist/
> INSTALL.md)
> > ===========================================================================
> ===
> > --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> > +++ head/contrib/libpcap/INSTALL.md     Sat Dec 21 21:01:03 2019        (r3
> 55988, copy of r353141, vendor/libpcap/dist/INSTALL.md)
> > @@ -0,0 +1,352 @@
> > +To build libpcap, run "./configure" (a shell script). The configure
> > +script will determine your system attributes and generate an
> > +appropriate Makefile from Makefile.in. Next run "make". If everything
> > +goes well you can su to root and run "make install". However, you need
> > +not install libpcap if you just want to build tcpdump; just make sure
> > +the tcpdump and libpcap directory trees have the same parent
> > +directory.
> > +
> > +If configure says:
> > +
> > +    configure: warning: cannot determine packet capture interface
> > +    configure: warning: (see INSTALL for more info)
> > +
> > +then your system either does not support packet capture or your system
> > +does support packet capture but libpcap does not support that
> > +particular type. (If you have HP-UX, see below.) If your system uses a
> > +packet capture not supported by libpcap, please send us patches; don't
> > +forget to include an autoconf fragment suitable for use in
> > +configure.ac.
> > +
> > +It is possible to override the default packet capture type, although
> > +the circumstance where this works are limited. For example if you have
> > +installed bpf under SunOS 4 and wish to build a snit libpcap:
> > +
> > +    ./configure --with-pcap=snit
> > +
> > +Another example is to force a supported packet capture type in the case
> > +where the configure scripts fails to detect it.
> > +
> > +You will need an ANSI C compiler to build libpcap. The configure script
> > +will abort if your compiler is not ANSI compliant. If this happens, use
> > +the generally available GNU C compiler (GCC).
> > +
> > +You will need either Flex 2.5.31 or later, or a version of Lex
> > +compatible with it (if any exist), to build libpcap.  The configure
> > +script will abort if there isn't any such program.  If you have an older
> > +version of Flex, or don't have a compatible version of Lex, the current
> > +version of flex is available at flex.sourceforge.net.
> > +
> > +You will need either Bison, Berkeley YACC, or a version of YACC
> > +compatible with them (if any exist), to build libpcap.  The configure
> > +script will abort if there isn't any such program.  If you don't have
> > +any such program, the current version of Bison can be found at
> > +http://ftp.gnu.org/gnu/bison/ and the current version of Berkeley YACC
> > +can be found at http://invisible-island.net/byacc/.
> > +
> > +Sometimes the stock C compiler does not interact well with Flex and
> > +Bison. The list of problems includes undefined references for alloca.
> > +You can get around this by installing GCC.
> > +
> > +If you use Solaris, there is a bug with bufmod(7) that is fixed in
> > +Solaris 2.3.2 (aka SunOS 5.3.2). Setting a snapshot length with the
> > +broken bufmod(7) results in data be truncated from the FRONT of the
> > +packet instead of the end.  The work around is to not set a snapshot
> > +length but this results in performance problems since the entire packet
> > +is copied to user space. If you must run an older version of Solaris,
> > +there is a patch available from Sun; ask for bugid 1149065. After
> > +installing the patch, use "setenv BUFMOD_FIXED" to enable use of
> > +bufmod(7). However, we recommend you run a more current release of
> > +Solaris.
> > +
> > +If you use the SPARCompiler, you must be careful to not use the
> > +/usr/ucb/cc interface. If you do, you will get bogus warnings and
> > +perhaps errors. Either make sure your path has /opt/SUNWspro/bin
> > +before /usr/ucb or else:
> > +
> > +    setenv CC /opt/SUNWspro/bin/cc
> > +
> > +before running configure. (You might have to do a "make distclean"
> > +if you already ran configure once).
> > +
> > +If you are trying to do packet capture with a FORE ATM card, you may or
> > +may not be able to. They usually only release their driver in object
> > +code so unless their driver supports packet capture, there's not much
> > +libpcap can do.
> > +
> > +If you get an error like:
> > +
> > +    tcpdump: recv_ack: bind error 0x???
> > +
> > +when using DLPI, look for the DL_ERROR_ACK error return values, usually
> > +in /usr/include/sys/dlpi.h, and find the corresponding value.
> > +
> > +Under {DEC OSF/1, Digital UNIX, Tru64 UNIX}, packet capture must be
> > +enabled before it can be used.  For instructions on how to enable packet
> > +filter support, see:
> > +
> > +       ftp://ftp.digital.com/pub/Digital/dec-faq/Digital-UNIX
> > +
> > +Look for the "How do I configure the Berkeley Packet Filter and capture
> > +tcpdump traces?" item.
> > +
> > +Once you enable packet filter support, your OSF system will support bpf
> >
> > *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
>


--==_Exmh_1588623126_39090
Content-Type: text/plain ; name="wpa-fix.diff"; charset=iso-8859-1
Content-Description: wpa-fix.diff
Content-Disposition: attachment; filename="wpa-fix.diff"
Content-Transfer-Encoding: 8bit

diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
index 837a31813..6067dc391 100644
--- a/src/drivers/driver_bsd.c
+++ b/src/drivers/driver_bsd.c
@@ -693,7 +693,7 @@ static void
 bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx)
 {
 	struct bsd_driver_data *drv = ctx;
-	char buf[2048];
+	char buf[2048] __attribute__ ((aligned (4)));
 	struct if_announcemsghdr *ifan;
 	struct rt_msghdr *rtm;
 	struct ieee80211_michael_event *mic;
@@ -1117,7 +1117,7 @@ static void
 wpa_driver_bsd_event_receive(int sock, void *ctx, void *sock_ctx)
 {
 	struct bsd_driver_data *drv = sock_ctx;
-	char buf[2048];
+	char buf[2048] __attribute__ ((aligned (4)));
 	struct if_announcemsghdr *ifan;
 	struct if_msghdr *ifm;
 	struct rt_msghdr *rtm;

--==_Exmh_1588623126_39090
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  https://FreeBSD.org
NTP:           <cy@nwtime.org>    Web:  https://nwtime.org

	The need of the many outweighs the greed of the few.

--==_Exmh_1588623126_39090--





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005042012.044KCpa4002687>