tcpdump mailing list archives

Re: libpcap: patches required for OpenSolaris/SXCE build >= 125


From: Guy Harris <guy () alum mit edu>
Date: Wed, 25 Nov 2009 11:54:00 -0800


On Nov 24, 2009, at 3:55 PM, Darren Reed wrote:

--- Makefile.in.dist    Mon Oct 27 18:26:13 2008
+++ Makefile.in Wed Oct 21 21:36:27 2009
@@ -44,6 +44,7 @@
# You shouldn't need to edit anything below.
#

+LD = /usr/bin/ld
CC = @CC@
CCOPT = @V_CCOPT@
INCLS = -I. @V_INCLS@
@@ -326,7 +327,7 @@
#
libpcap.so: $(OBJ)
        @rm -f $@
- $(CC) -shared -Wl,-soname,$@.1 -o $@.`cat $(srcdir)/VERSION` $ (OBJ) $(DAGLIBS) + $(LD) -shared -Wl,-soname,$@.1 -o $@.`cat $(srcdir)/VERSION` $ (OBJ) $(DAGLIBS)

This doesn't apply any more. Please look at the top-of-tree Git version of libpcap, rather than 1.0.0; the command used to build a shared library is set in the AC_LBL_C_INIT macro in aclocal.m4.

#
# The following rule succeeds, but the result is untested.
--- pcap/bpf.h  Fri Oct 10 19:42:44 2008
+++ pcap/bpf.h.new      Tue Sep 15 21:06:40 2009
@@ -821,8 +821,17 @@
 */
#define DLT_IEEE802_15_4_NONASK_PHY     215

+#define        DLT_IPNET               226     /* Assigned by tcpdump.org */

This is already set in the top-of-tree Git pcap/bpf.h.

+#define        DLT_IPOIB               162     /* Private until we know what it is */

162 is DLT_USER15, so we shouldn't advertise it as being any particular link-layer type - and DLT_IPOIB isn't used by any of the post-patch code, so it doesn't need to be defined.

I'll remove both of those from the top-of-tree version.

/*
+ * IPNET
+ */
+#define        IPNET_OUTBOUND          1
+#define        IPNET_INBOUND           2

Perhaps this belongs in a pcap/ipnet.h header, instead.

--- configure.in.dist   Tue Sep 25 19:09:46 2007
+++ configure.in        Fri Jul 17 13:08:17 2009
@@ -187,7 +187,7 @@
AC_MSG_CHECKING(packet capture type)
if test ! -z "$with_pcap" ; then
        V_PCAP="$withval"
-elif test -r /dev/bpf ; then
+elif test -r /dev/bpf -o -h /dev/bpf ; then
        #
        # Cloning BPF device.
        #

The test(1) man page on OS X says of "-h":

-h file True if file exists and is a symbolic link. This operator is retained for compatibility with previous versions of this program. Do not rely on its existence; use -L instead.

                ...

     -L file       True if file exists and is a symbolic link.

Is there a flag to test that tests for a symlink and that's guaranteed to work on all UN*Xes - or, at least, all sufficiently modern UN*Xes?
***************
*** 7250,7255 ****
--- 7288,7305 ----
                          dir);
                break;

+ #ifdef DL_IPNET
+       case DLT_IPNET:
+               if (dir) {
+                       /* match outgoing packets */
+                       b0 = gen_cmp(OR_LINK, 2, BPF_H, IPNET_OUTBOUND);
+               } else {
+                       /* match incoming packets */
+                       b0 = gen_cmp(OR_LINK, 2, BPF_H, IPNET_INBOUND);
+               }
+               break;
+ #endif
+

Why the #ifdef protection? It's not as if the code won't compile if DLT_IPNET isn't defined, and elsewhere the code just assumes DLT_IPNET is defined (which it is, in the top-of-tree version).
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: