new 2.2-or-later kernel, with PF_PACKET sockets including SOL_PACKET,
but with an older version of the C library whose headers don't define
SOL_PACKET.
On those systems, define SOL_PACKET to have the value it has in the
2.2.0 kernel; this means we can get rid of the "#ifdef
SOL_PACKET"/#endif stuff wrapped around the code to turn promiscuous
mode on or off (we don't want that #ifdeffed out, as if it's absent we
won't pay attention to the "promiscuous mode" flag argument to
"pcap_open_live()").
*/
#ifndef lint
static const char rcsid[] =
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.81 2002-06-11 17:04:47 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.82 2002-07-06 21:22:35 guy Exp $ (LBL)";
#define MSG_TRUNC 0x20
#endif
#define MSG_TRUNC 0x20
#endif
+#ifndef SOL_PACKET
+/*
+ * This is being compiled on a system that lacks SOL_PACKET; define it
+ * with the value it has in the 2.2 and later kernels, so that we can
+ * set promiscuous mode in the good modern way rather than the old
+ * 2.0-kernel crappy way.
+ */
+#define SOL_PACKET 263
+#endif
+
#define MAX_LINKHEADER_SIZE 256
/*
#define MAX_LINKHEADER_SIZE 256
/*
/* Select promiscuous mode on/off */
/* Select promiscuous mode on/off */
/*
* Hmm, how can we set promiscuous mode on all interfaces?
* I am not sure if that is possible at all.
/*
* Hmm, how can we set promiscuous mode on all interfaces?
* I am not sure if that is possible at all.
/* Save the socket FD in the pcap structure */
/* Save the socket FD in the pcap structure */