-
Notifications
You must be signed in to change notification settings - Fork 978
Open
Description
Bug
On MinGW/MSYS2, passing --with-only-libndpi to configure triggers a PKG_CHECK_MODULES check for libpcap, causing configure to fail if libpcap-dev is not installed. This is the opposite of the intended behavior — building only the library should not require pcap.
Root cause
In configure.ac line 344, the AS_IF condition for the MinGW pcap check is inverted:
AS_IF([test "${enable_npcap+set}" != set && test "${with_only_libndpi+set}" != set],,
[PKG_CHECK_MODULES([PCAP], [libpcap], [PCAP_LIB="" PCAP_INC="${pkg_cv_PCAP_CFLAGS}"])
AC_CHECK_LIB([pcap], [pcap_open_live],, [AC_MSG_ERROR([Missing msys2/mingw libpcap library. ...])])])The empty then-body (,,) means:
- When neither flag is set (default): pcap check skipped (correct)
- When
--with-only-libndpiis set: pcap check runs (incorrect)
Compare with the non-MinGW path (line 365) which correctly skips pcap when --with-only-libndpi is set:
elif test "${with_only_libndpi+set}" != set; then :
AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"])Error output
checking for libpcap... no
configure: error: Package requirements (libpcap) were not met:
Package 'libpcap' not found
Steps to reproduce
On MSYS2/MinGW64:
./autogen.sh
./configure --with-only-libndpiSuggested fix
The MinGW pcap check should only run when npcap is explicitly enabled and --with-only-libndpi is not set.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels