Skip to content

Commit 0eaff2d

Browse files
committed
Define pcap_open() etc. even without remote capture.
They also support local capture, and we build them even without remote capture, as their absence may complicate code build on macOS 14 with Xcode 15, as that platform supports "weakly linked symbols": https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html which are symbols in dynamically-linked shared libraries, declared in such a fashion that if a program linked against a newer software development kit (SDK), and using a symbol present in the OS version for which that SDK is provided, is run on an older OS version that lacks that symbol, that symbol's value is a NULL pointer. This allows those programs to test for the presence of that symbol by checking whether it's non-null and, if it is, using the symbol, otherwise not using it. See Wireshark issue 19349: https://gitlab.com/wireshark/wireshark/-/issues/19349 and this note in that issue: https://gitlab.com/wireshark/wireshark/-/issues/19349#note_1573375784 for a possible example of such a complication (Apple may have added a stub pcap_open() to handle this, but that breaks code that expects pcap_open() to work if present). Add pcap_open() support in the opentest test program, with the -o flag.
1 parent 7d8a38a commit 0eaff2d

File tree

8 files changed

+562
-517
lines changed

8 files changed

+562
-517
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2693,7 +2693,7 @@ if(ENABLE_REMOTE)
26932693
check_struct_has_member("struct msghdr" msg_flags "ftmacros.h;sys/socket.h" HAVE_STRUCT_MSGHDR_MSG_FLAGS)
26942694
cmake_pop_check_state()
26952695
set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C}
2696-
pcap-new.c pcap-rpcap.c rpcap-protocol.c sockutils.c sslutils.c)
2696+
pcap-rpcap.c rpcap-protocol.c sockutils.c sslutils.c)
26972697
endif(ENABLE_REMOTE)
26982698

26992699
###################################################################

Makefile.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ EXTRA_DIST = \
321321
pcap-libdlpi.c \
322322
pcap-linux.c \
323323
pcap-namedb.h \
324-
pcap-new.c \
325324
pcap-netfilter-linux.c \
326325
pcap-netfilter-linux.h \
327326
pcap-netmap.c \

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ return 0;
19451945

19461946
AC_DEFINE(ENABLE_REMOTE,,
19471947
[Define to 1 if remote packet capture is to be supported])
1948-
REMOTE_C_SRC="$REMOTE_C_SRC pcap-new.c pcap-rpcap.c rpcap-protocol.c sockutils.c sslutils.c"
1948+
REMOTE_C_SRC="$REMOTE_C_SRC pcap-rpcap.c rpcap-protocol.c sockutils.c sslutils.c"
19491949
BUILD_RPCAPD=build-rpcapd
19501950
INSTALL_RPCAPD=install-rpcapd
19511951
;;

0 commit comments

Comments
 (0)