From 48b3b4cdfb1c57c43c976a932159db7009bcea88 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 3 Aug 2002 20:26:14 +0000 Subject: Get rid of an old comment (yes, including is the right thing to do on AIX to get the IFT_ values, at least on the AIX 4.3.3 or so that I tried it on), and add some new comments about IBM's tcpdump forcibly enabling BPF and asking whether AIX uses seconds/nanoseconds or seconds/microseconds for timeouts. --- pcap-bpf.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pcap-bpf.c b/pcap-bpf.c index af87b8b..083e9f0 100644 --- a/pcap-bpf.c +++ b/pcap-bpf.c @@ -20,7 +20,7 @@ */ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.51 2002-07-11 09:06:36 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.52 2002-08-03 20:26:14 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -36,13 +36,6 @@ static const char rcsid[] = #include #ifdef _AIX -/* - * XXX - I'm guessing here AIX defines IFT_ values in , - * as BSD does. If not, this code won't compile, but, if not, you - * want to send us a bug report and fall back on using DLPI. - * It's not as if BPF used to work right on AIX before this change; - * this change attempts to fix the fact that it didn't.... - */ #include /* for IFT_ values */ #endif @@ -198,6 +191,16 @@ bpf_open(pcap_t *p, char *errbuf) return (fd); } +/* + * XXX - on AIX, IBM's tcpdump (and perhaps the incompatible-with-everybody- + * else's libpcap in AIX 5.1) appears to forcibly load the BPF driver + * if it's not already loaded, and to create the BPF devices if they + * don't exist. + * + * It'd be nice if we could do the same, although the code to do so + * might be version-dependent, alas (the way to do it isn't necessarily + * documented). + */ pcap_t * pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf) { @@ -325,6 +328,11 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf) /* set timeout */ if (to_ms != 0) { + /* + * XXX - is this seconds/nanoseconds in AIX? + * (Treating it as such doesn't fix the timeout + * problem described below.) + */ struct timeval to; to.tv_sec = to_ms / 1000; to.tv_usec = (to_ms * 1000) % 1000000; -- cgit v1.2.3